Quick correction attempt for ruby 1.9 in production
This commit is contained in:
parent
9374e442e0
commit
46f4316b05
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user