2018-03-06 13:44:29 +01:00
|
|
|
class ModuleAPICarto < ApplicationRecord
|
2015-12-07 11:29:34 +01:00
|
|
|
belongs_to :procedure
|
|
|
|
|
2015-12-08 10:11:58 +01:00
|
|
|
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
|
2016-01-15 11:53:00 +01:00
|
|
|
|
|
|
|
def classes
|
2018-10-01 13:24:37 +02:00
|
|
|
modules = ''
|
2016-01-15 11:53:00 +01:00
|
|
|
|
2018-10-01 13:24:37 +02:00
|
|
|
if quartiers_prioritaires?
|
|
|
|
modules += 'qp '
|
|
|
|
end
|
|
|
|
|
|
|
|
if cadastre?
|
|
|
|
modules += 'cadastre '
|
|
|
|
end
|
2016-01-15 11:53:00 +01:00
|
|
|
|
|
|
|
modules
|
|
|
|
end
|
2015-12-07 11:29:34 +01:00
|
|
|
end
|