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

remotes/origin/master
echarp 4 years ago
parent b5270266a0
commit 5d2aa47046
  1. 2
      app/models/event.rb

@ -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…
Cancel
Save