diff --git a/app/models/event.rb b/app/models/event.rb index 3e3cc378..ebf8e496 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -35,7 +35,7 @@ class Event < ActiveRecord::Base scope :last_year, -> { where '? <= end_time', 1.year.ago } scope :past, -> { where 'start_time <= ?', Time.zone.now } scope :future, -> { where '? <= end_time', Time.zone.now } - scope :daylimit, -> (d) { where 'end_time <= ?', d.to_i.days.from_now } + scope :daylimit, ->(d) { where 'end_time <= ?', d.to_i.days.from_now } scope :year, (lambda do |year| where '? <= end_time and start_time <= ?', Date.new(year.to_i, 1, 1).beginning_of_week, @@ -51,9 +51,9 @@ class Event < ActiveRecord::Base where '? <= end_time and start_time <= ?', start_date, start_date.end_of_week.end_of_day end) - scope :region, -> (region) { where region: region unless region == 'all' } - scope :locality, -> (locality) { where locality: locality } - scope :tag, -> (tag) { where 'tags like ?', "%#{tag}%" } + scope :region, ->(region) { where region: region unless region == 'all' } + scope :locality, ->(locality) { where locality: locality } + scope :tag, ->(tag) { where 'tags like ?', "%#{tag}%" } scope :geo, -> { where 'latitude is not null and longitude is not null' } before_validation do