aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorAlban Peignier2016-05-15 18:53:46 +0200
committerAlban Peignier2016-05-15 18:53:46 +0200
commit99f988b54837a7eb1f20294a8e5ce4811f727c5d (patch)
treecd698def670d4fc186b9bbe9ae48796c478bc4df /app
parent220ffe5948655d94854af47f50415d25d4e14f7a (diff)
downloadchouette-core-99f988b54837a7eb1f20294a8e5ce4811f727c5d.tar.bz2
Add Referential#offer_workbench. Refs #839
Diffstat (limited to 'app')
-rw-r--r--app/models/offer_workbench.rb2
-rw-r--r--app/models/referential.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/models/offer_workbench.rb b/app/models/offer_workbench.rb
index 2288d5bbb..a1c8f3b9c 100644
--- a/app/models/offer_workbench.rb
+++ b/app/models/offer_workbench.rb
@@ -4,4 +4,6 @@ class OfferWorkbench < ActiveRecord::Base
validates :name, presence: true, uniqueness: true
validates :organisation, presence: true
+ has_many :referentials
+
end
diff --git a/app/models/referential.rb b/app/models/referential.rb
index 53286d61d..af2cc2182 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -33,6 +33,8 @@ class Referential < ActiveRecord::Base
# validates_presence_of :stop_area_referential
has_many :stop_areas, through: :stop_area_referential
+ belongs_to :offer_workbench
+
def slug_excluded_values
if ! slug.nil?
if slug.start_with? "pg_"