diff options
Diffstat (limited to 'app/models/chouette/line.rb')
| -rw-r--r-- | app/models/chouette/line.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb index 50dd9b1b3..f44375e7d 100644 --- a/app/models/chouette/line.rb +++ b/app/models/chouette/line.rb @@ -14,6 +14,7 @@ class Chouette::Line < Chouette::ActiveRecord belongs_to :company belongs_to :network + belongs_to :line_referential has_array_of :secondary_companies, class_name: 'Chouette::Company' @@ -75,4 +76,8 @@ class Chouette::Line < Chouette::ActiveRecord [name, company.try(:name)].compact.join(' - ') end + def companies + line_referential.companies.where(id: ([company_id] + Array(secondary_company_ids)).compact) + end + end |
