How I rewrite these using lambdas to remove the deprecation warnings?
default_scope include:[:room,:teacher,:subject]
and
has_many :timetable_entries, dependent: :destroy, include: [:class_timing,:weekday,:small_group]
How I rewrite these using lambdas to remove the deprecation warnings?
default_scope include:[:room,:teacher,:subject]
and
has_many :timetable_entries, dependent: :destroy, include: [:class_timing,:weekday,:small_group]
default_scope do
includes(:room, :teacher, :subject)
end
and how about the latter one? I used this for the first one but could not convert the latter to lambda. Kept getting => type of errors.
default_scope -> { includes(:room).includes(:teacher).includes(:subject)}