]> git.openstreetmap.org Git - rails.git/blob - app/models/user_preference.rb
Make traces/mine redirect to the user's traces page instead of rendering
[rails.git] / app / models / user_preference.rb
1 class UserPreference < ActiveRecord::Base
2   set_primary_keys :user_id, :k
3   belongs_to :user
4   
5   validates_length_of :k, :within => 1..255
6   validates_length_of :v, :within => 1..255
7
8   # Turn this Node in to an XML Node without the <osm> wrapper.
9   def to_xml_node
10     el1 = XML::Node.new 'preference'
11     el1['k'] = self.k
12     el1['v'] = self.v
13     
14     return el1
15   end
16
17 end