More tag validations, and finishing the node/way/relation tests.
This commit is contained in:
parent
55d511bf21
commit
ffbc4d5cb2
7 changed files with 40 additions and 7 deletions
|
@ -5,4 +5,6 @@ class NodeTag < ActiveRecord::Base
|
|||
|
||||
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
|
||||
end
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
class OldNodeTag < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
set_table_name 'node_tags'
|
||||
|
||||
belongs_to :user
|
||||
|
||||
validates_presence_of :id, :version
|
||||
validates_length_of :k, :v, :maximum => 255, :allow_blank => true
|
||||
|
||||
validates_uniqueness_of :id, :scope => [:k, :version]
|
||||
validates_numericality_of :id, :version, :only_integer => true
|
||||
end
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
class OldRelationTag < ActiveRecord::Base
|
||||
set_table_name 'relation_tags'
|
||||
|
||||
belongs_to :old_relation, :foreign_key => [:id, :version]
|
||||
|
||||
validates_presence_of :id, :version
|
||||
validates_length_of :k, :v, :maximum => 255, :allow_blank => true
|
||||
validates_uniqueness_of :id, :scope => [:k, :version]
|
||||
validates_numericality_of :id, :version, :only_integer => true
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
class OldWayTag < ActiveRecord::Base
|
||||
belongs_to :old_way
|
||||
|
||||
set_table_name 'way_tags'
|
||||
|
||||
belongs_to :old_way, :foreign_key => [:id, :version]
|
||||
|
||||
validates_presence_of :id
|
||||
validates_length_of :k, :v, :maximum => 255, :allow_blank => true
|
||||
validates_uniqueness_of :id, :scope => [:k, :version]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue