]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Remember whether the user set the public checkbox on GPX upload as a user preference...
[rails.git] / app / models / user.rb
index 80faf68e9137c7ba60d2f75ef6073ed2f598e7d3..0eddb259d01213506df8aa502aa71076b0a669aa 100644 (file)
@@ -9,6 +9,7 @@ class User < ActiveRecord::Base
   has_many :friends, :include => :befriendee, :conditions => ["users.visible = ?", true]
   has_many :tokens, :class_name => "UserToken"
   has_many :preferences, :class_name => "UserPreference"
+  has_many :changesets
 
   validates_presence_of :email, :display_name
   validates_confirmation_of :email, :message => 'Email addresses must match'
@@ -105,4 +106,8 @@ class User < ActiveRecord::Base
     return false
   end
 
+  def trace_public_default
+    return self.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"})
+  end
+
 end