From 46f4316b055d3cf9518c4054baff44c702bd6d64 Mon Sep 17 00:00:00 2001 From: echarp Date: Tue, 10 Nov 2015 23:40:56 +0100 Subject: [PATCH] Quick correction attempt for ruby 1.9 in production --- app/models/event.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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