]> git.openstreetmap.org Git - rails.git/blob - app/models/user_preference.rb
Move some javascript functions out of global scope
[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"] = k
13     el1["v"] = v
14
15     el1
16   end
17 end