diff options
| author | Robert | 2017-12-05 15:52:44 +0100 |
|---|---|---|
| committer | Robert | 2017-12-05 15:52:44 +0100 |
| commit | b50bcb8d6d0da921c002afb550a8aa4dffa3c2f0 (patch) | |
| tree | e3df1033b2def0e6beff45f637388c2a0d83c2b0 /app | |
| parent | af721b243b551822829b224231f20c1b941975e1 (diff) | |
| download | chouette-core-b50bcb8d6d0da921c002afb550a8aa4dffa3c2f0.tar.bz2 | |
Fixes: #5179@1h; Referential Creation Enforces objectid_format from associated Workbench5179-ref_creation_enforces_objectid_format
- CR changes implemented
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 |
