Quick correction so that filtering with region=all will not fail
This commit is contained in:
parent
b5270266a0
commit
5d2aa47046
|
@ -63,6 +63,8 @@ class Event < ApplicationRecord
|
|||
start_date, start_date.end_of_week.end_of_day
|
||||
end)
|
||||
scope :region, (lambda do |region|
|
||||
return if region == 'all'
|
||||
|
||||
temp = Region.find region
|
||||
where region: [temp, temp.regions].flatten
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue