demarches-normaliennes/app/models/module_api_carto.rb

17 lines
455 B
Ruby
Raw Normal View History

2018-03-06 13:44:29 +01:00
class ModuleAPICarto < ApplicationRecord
2015-12-07 11:29:34 +01:00
belongs_to :procedure
validates :use_api_carto, presence: true, allow_blank: true, allow_nil: false
validates :quartiers_prioritaires, presence: true, allow_blank: true, allow_nil: false
validates :cadastre, presence: true, allow_blank: true, allow_nil: false
def classes
modules = ''
modules += 'qp ' if quartiers_prioritaires?
modules += 'cadastre ' if cadastre?
modules
end
2015-12-07 11:29:34 +01:00
end