openstreetmap-website/app/models/user_preference.rb
Tom Hughes 02efd7ba4a Go back to using user_id+k as the primary key for user preferences but
actually using the composite primary key extension this time so that it
really works.

Also stop update_one tring to render a non-existent view, and add a
delete_one method to allow preferences to be deleted.
2008-05-04 11:18:38 +00:00

14 lines
288 B
Ruby

class UserPreference < ActiveRecord::Base
set_primary_keys :user_id, :k
belongs_to :user
# Turn this Node in to an XML Node without the <osm> wrapper.
def to_xml_node
el1 = XML::Node.new 'preference'
el1['k'] = self.k
el1['v'] = self.v
return el1
end
end