aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/line.rb
diff options
context:
space:
mode:
authorZog2018-03-29 14:38:45 +0200
committerZog2018-03-29 14:38:45 +0200
commitef01bea2bef74358e3df3e74cc613d664a9a554d (patch)
tree19b375858b37645754198c048841458621d23737 /app/models/chouette/line.rb
parent1019debe93d776f0d38ae69099e6492a7dd4a87c (diff)
downloadchouette-core-ef01bea2bef74358e3df3e74cc613d664a9a554d.tar.bz2
Refs #4658; Remove `current_functional_scope`
Diffstat (limited to 'app/models/chouette/line.rb')
-rw-r--r--app/models/chouette/line.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb
index ae7c25377..c8a02da1f 100644
--- a/app/models/chouette/line.rb
+++ b/app/models/chouette/line.rb
@@ -51,6 +51,14 @@ module Chouette
)
}
+ scope :for_organisation, ->(organisation){
+ if objectids = organisation&.lines_scope
+ where(objectid: objectids)
+ else
+ all
+ end
+ }
+
def self.nullable_attributes
[:published_name, :number, :comment, :url, :color, :text_color, :stable_id]
end