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
|
start_date, start_date.end_of_week.end_of_day
|
||||||
end)
|
end)
|
||||||
scope :region, (lambda do |region|
|
scope :region, (lambda do |region|
|
||||||
|
return if region == 'all'
|
||||||
|
|
||||||
temp = Region.find region
|
temp = Region.find region
|
||||||
where region: [temp, temp.regions].flatten
|
where region: [temp, temp.regions].flatten
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue