]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset_tag.rb
Fix up case statement syntax for ruby 1.9 compatibility
[rails.git] / app / models / changeset_tag.rb
index 6a414a0fcb8506d2c3118361341354c42e36359f..bd0417ab4255af3a32ff6a56b4a895a3460a02ee 100644 (file)
@@ -1,8 +1,10 @@
 class ChangesetTag < ActiveRecord::Base
 class ChangesetTag < ActiveRecord::Base
-  belongs_to :changeset, :foreign_key => 'id'
+  set_primary_keys :changeset_id, :k
 
 
-  validates_presence_of :id
-  validates_length_of :k, :v, :maximum => 255, :allow_blank => true
-  validates_uniqueness_of :id, :scope => :k
-  validates_numericality_of :id, :only_integer => true
+  belongs_to :changeset
+
+  validates_presence_of :changeset
+  validates_length_of :k, :maximum => 255, :allow_blank => true
+  validates_uniqueness_of :k, :scope => :changeset_id
+  validates_length_of :v, :maximum => 255, :allow_blank => true
 end
 end