aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/workbench.rb
diff options
context:
space:
mode:
authorcedricnjanga2017-11-16 16:44:37 +0100
committerGuillaume2017-11-16 16:44:37 +0100
commit3f39b62beb9ff7af741696a6c3c7e87737c3a257 (patch)
treecbb89c8eb78fa9349bf499ffc01483d25554c3d0 /app/models/workbench.rb
parente5fcb0cc0728cbb673c1f5cf346e865fbbbc593a (diff)
downloadchouette-core-3f39b62beb9ff7af741696a6c3c7e87737c3a257.tar.bz2
Add Cédric new objectid concerns
objectid_support handles reading and writing object_ids objectid_formater_support gets the right formater class include these concerns in chouette models Remove StifNetexAttributSupport modules because these are handled by the new objectid concerns Add a objectid and formater classes for each format type Add objectid formats to the factories Modify somes specs for object_ids but there are still a number of failling tests
Diffstat (limited to 'app/models/workbench.rb')
-rw-r--r--app/models/workbench.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/workbench.rb b/app/models/workbench.rb
index 8a48b0f9f..5c8bfa782 100644
--- a/app/models/workbench.rb
+++ b/app/models/workbench.rb
@@ -1,11 +1,11 @@
class Workbench < ActiveRecord::Base
+ include ObjectidFormaterSupport
extend Enumerize
belongs_to :organisation
belongs_to :line_referential
belongs_to :stop_area_referential
belongs_to :output, class_name: 'ReferentialSuite'
- enumerize :objectid_format, in: %w(netex stif_netex)
- validates_presence_of :objectid_format
+ enumerize :objectid_format, in: %w(netex stif_netex stif_reflex stif_codifligne)
has_many :lines, -> (workbench) { Stif::MyWorkbenchScopes.new(workbench).line_scope(self) }, through: :line_referential
has_many :networks, through: :line_referential
@@ -20,6 +20,7 @@ class Workbench < ActiveRecord::Base
validates :name, presence: true
validates :organisation, presence: true
validates :output, presence: true
+ validates_presence_of :objectid_format
has_many :referentials
has_many :referential_metadatas, through: :referentials, source: :metadatas