X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..26d7f66fbdcd95bdbfebc9c995e206b53dca3ef3:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index bc47aa8e0..5e609786d 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -8,6 +8,7 @@ class Trace < ActiveRecord::Base scope :visible, where(:visible => true) scope :visible_to, lambda { |u| visible.where("visibility IN ('public', 'identifiable') OR user_id = ?", u) } scope :public, where(:visibility => ["public", "identifiable"]) + scope :tagged, lambda { |t| joins(:tags).where(:gpx_file_tags => { :tag => t }) } validates_presence_of :user_id, :name, :timestamp validates_presence_of :description, :on => :create