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