determine default zones according to tchap hs
This commit is contained in:
parent
d0ca05259a
commit
3705dc2553
3 changed files with 20 additions and 0 deletions
|
@ -33,4 +33,9 @@ class Zone < ApplicationRecord
|
|||
OpenStruct.new(id: zone.id, label: zone.label_at(date))
|
||||
end
|
||||
end
|
||||
|
||||
def self.default_for(tchap_hs)
|
||||
sanitized_sql = ActiveRecord::Base.sanitize_sql "'#{tchap_hs}' = ANY (tchap_hs)"
|
||||
Zone.where(sanitized_sql)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue