Skip to content
Extraits de code Groupes Projets
Valider 46f4316b rédigé par echarp's avatar echarp
Parcourir les fichiers

Quick correction attempt for ruby 1.9 in production

parent 9374e442
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter