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