]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset_tag.rb
Reduce the effect of the user description on the spam score
[rails.git] / app / models / changeset_tag.rb
index 6298fbe778e8da9870c41f3f82976ff24287a6c0..bd0417ab4255af3a32ff6a56b4a895a3460a02ee 100644 (file)
@@ -1,5 +1,10 @@
 class ChangesetTag < ActiveRecord::Base
+  set_primary_keys :changeset_id, :k
 
-  belongs_to :changeset, :foreign_key => 'id'
+  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