Quick correction so that filtering with region=all will not fail

This commit is contained in:
echarp 2019-02-12 14:19:52 +01:00
parent b5270266a0
commit 5d2aa47046
1 changed files with 2 additions and 0 deletions

View File

@ -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)