diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/concerns/objectid_formatter_support.rb | 7 | ||||
| -rw-r--r-- | app/models/referential.rb | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/app/models/concerns/objectid_formatter_support.rb b/app/models/concerns/objectid_formatter_support.rb index 3ef45334c..edc7704b4 100644 --- a/app/models/concerns/objectid_formatter_support.rb +++ b/app/models/concerns/objectid_formatter_support.rb @@ -1,14 +1,9 @@ module ObjectidFormatterSupport extend ActiveSupport::Concern - def self.legal_formats - %w(netex stif_netex stif_reflex stif_codifligne) - end - - included do extend Enumerize - enumerize :objectid_format, in: ObjectidFormatterSupport.legal_formats + enumerize :objectid_format, in: %w(netex stif_netex stif_reflex stif_codifligne) validates_presence_of :objectid_format def objectid_formatter diff --git a/app/models/referential.rb b/app/models/referential.rb index e8fb2888e..ca20c639f 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -131,7 +131,7 @@ class Referential < ActiveRecord::Base def define_default_attributes self.time_zone ||= Time.zone.name - self.objectid_format ||= workbench.try(:objectid_format) || ObjectidFormatterSupport.legal_formats.first + self.objectid_format ||= workbench.objectid_format if workbench end def switch |
