]> git.openstreetmap.org Git - rails.git/blob - app/models/user_preference.rb
Increase whitespace between comments in the note popup
[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   attr_accessible :k, :v
10
11   # Turn this Node in to an XML Node without the <osm> wrapper.
12   def to_xml_node
13     el1 = XML::Node.new 'preference'
14     el1['k'] = self.k
15     el1['v'] = self.v
16     
17     return el1
18   end
19
20 end