X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/221ca3c1fa985c02243a3c650c828023c1011484..78631eb0cc05881452aa71ddfa628573abe5e098:/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