diff options
| author | Alban Peignier | 2016-05-13 11:56:54 +0200 |
|---|---|---|
| committer | Alban Peignier | 2016-05-13 11:56:54 +0200 |
| commit | 6e28e49262ede9c57a6c5726570a4921f4b63d04 (patch) | |
| tree | 31a26a03e2c1dd3af796c9854918d112ad6e97c8 /app/models/line_referential.rb | |
| parent | 781142afdb90bb0ca62783435f582725794f4f57 (diff) | |
| download | chouette-core-6e28e49262ede9c57a6c5726570a4921f4b63d04.tar.bz2 | |
Refactor models and controllers to manage Lines in LineReferential. Refs #825
Diffstat (limited to 'app/models/line_referential.rb')
| -rw-r--r-- | app/models/line_referential.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb index b5ba56d7b..9c6f324e8 100644 --- a/app/models/line_referential.rb +++ b/app/models/line_referential.rb @@ -2,6 +2,9 @@ class LineReferential < ActiveRecord::Base has_many :line_referential_memberships has_many :organisations, through: :line_referential_memberships + has_many :lines, class_name: 'Chouette::Line' + has_many :group_of_lines, class_name: 'Chouette::GroupOfLine' + def add_member(organisation, options = {}) attributes = options.merge organisation: organisation line_referential_memberships.build attributes |
