|
|
|
@ -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 |
|
|
|
|