diff options
| author | Vlatka Pavisic | 2017-01-30 14:28:53 +0100 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-01-30 14:29:07 +0100 | 
| commit | 8ce5d4f67210990e22a716b82a7d3fb634d80fa9 (patch) | |
| tree | 7130fd33d5178d0c46e6a4b2d8487f118092b08e /app/models/workbench.rb | |
| parent | d8c77d0c4cfe27747c4f6000fb8b4ef46d5b4be0 (diff) | |
| download | chouette-core-8ce5d4f67210990e22a716b82a7d3fb634d80fa9.tar.bz2 | |
Refs #2474 : Show all referentials in workbenches#show
Diffstat (limited to 'app/models/workbench.rb')
| -rw-r--r-- | app/models/workbench.rb | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/workbench.rb b/app/models/workbench.rb index 419790edb..21c586873 100644 --- a/app/models/workbench.rb +++ b/app/models/workbench.rb @@ -14,4 +14,14 @@ class Workbench < ActiveRecord::Base    has_many :referentials    has_many :referential_metadatas, through: :referentials, source: :metadatas + + +  def all_referentials +    if line_ids.empty? +      Referential.none +    else +      Referential.joins(:metadatas).where(['referential_metadata.line_ids && ARRAY[?]', line_ids]).ready +    end +  end +  end  | 
