From 6a786a16c165935a7f7ede4d52d743fb5d84793b Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 1 Jun 2014 15:06:04 +0200 Subject: [PATCH] =?UTF-8?q?Les=20=C3=A9v=C3=A9nements=20globaux=20sont=20a?= =?UTF-8?q?ffich=C3=A9s=20pour=20toutes=20les=20r=C3=A9gions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/event.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 87ec7b7c..8ce67e1b 100644 --- a/app/models/event.rb +++ b/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