Another attempt :)

This commit is contained in:
echarp 2018-03-18 16:41:07 +01:00
parent 64cd896006
commit 669471aa59

View File

@ -6,7 +6,7 @@ class Region < ApplicationRecord
has_many :orgas, dependent: :destroy
default_scope { order :name }
scope :local, ->(*) { where url: '' }
scope :local, ->(*) { where 'url IS NULL OR url = \'\'' }
scope :region, (lambda do |region|
return if region.nil? || region == 'all' || region.to_i.zero?
temp = Region.find region