Quick correction, to manage the region zero
This commit is contained in:
parent
950728ae50
commit
9638996386
@ -64,7 +64,7 @@ class Event < ApplicationRecord
|
|||||||
start_date, start_date.end_of_week.end_of_day
|
start_date, start_date.end_of_week.end_of_day
|
||||||
end)
|
end)
|
||||||
scope :region, (lambda do |region|
|
scope :region, (lambda do |region|
|
||||||
return if region.nil? || region == 'all'
|
return if region.nil? || region == 'all' || region.zero?
|
||||||
temp = Region.find region
|
temp = Region.find region
|
||||||
where region: [temp, temp.regions].flatten
|
where region: [temp, temp.regions].flatten
|
||||||
end)
|
end)
|
||||||
|
@ -33,7 +33,7 @@ class Orga < ApplicationRecord
|
|||||||
|
|
||||||
scope :kind, ->(kind) { where kind: kind }
|
scope :kind, ->(kind) { where kind: kind }
|
||||||
scope :region, (lambda do |region|
|
scope :region, (lambda do |region|
|
||||||
return if region.nil? || region == 'all'
|
return if region.nil? || region == 'all' || region.zero?
|
||||||
temp = Region.find region
|
temp = Region.find region
|
||||||
where region: [temp, temp.regions].flatten
|
where region: [temp, temp.regions].flatten
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user