]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_preference.rb
Fix bug allowing created elements to reference deleted ones
[rails.git] / app / models / user_preference.rb
index 0533ccad2d83857a967feefdb2703b1e19c145ac..7c65a589953a688e3d4aa87e533ac00e9c8839ce 100644 (file)
@@ -3,8 +3,8 @@ class UserPreference < ActiveRecord::Base
 
   belongs_to :user
 
-  validates_length_of :k, :within => 1..255
-  validates_length_of :v, :within => 1..255
+  validates :user, :presence => true, :associated => true
+  validates :k, :v, :length => 1..255
 
   # Turn this Node in to an XML Node without the <osm> wrapper.
   def to_xml_node