Browse Source

Les événements globaux sont affichés pour toutes les régions

recurrent
echarp 8 years ago
parent
commit
6a786a16c1
  1. 4
      app/models/event.rb

4
app/models/event.rb

@ -26,8 +26,8 @@ class Event < ActiveRecord::Base
"#{year}-#{month.to_i-1}-23",
"#{month == '12' ? year.to_i+1 : year}-#{month == '12' ? 1 : month.to_i+1}-7"
}
scope :region, -> region { where region: region }
scope :tag, -> tag { where "tags like ?", "%#{tag}%" }
scope :region, -> region { where 'region = ? or locality', region }
scope :tag, -> tag { where 'tags like ?', "%#{tag}%" }
before_validation(on: :create) do

Loading…
Cancel
Save