X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1f8df781be6788a43e0a76a9874366930473f64c..c5c344b12c6b538cce39b372079b051a6071c5b0:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index 4200a08dd..0a4a660a6 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -27,9 +27,9 @@ class Relation < ApplicationRecord belongs_to :changeset - has_many :old_relations, -> { order(:version) } + has_many :old_relations, -> { order(:version) }, :inverse_of => :current_relation - has_many :relation_members, -> { order(:sequence_id) } + has_many :relation_members, -> { order(:sequence_id) }, :inverse_of => :relation has_many :relation_tags has_many :containing_relation_members, :class_name => "RelationMember", :as => :member @@ -39,8 +39,6 @@ class Relation < ApplicationRecord :numericality => { :on => :update, :only_integer => true } validates :version, :presence => true, :numericality => { :only_integer => true } - validates :changeset_id, :presence => true, - :numericality => { :only_integer => true } validates :timestamp, :presence => true validates :changeset, :associated => true validates :visible, :inclusion => [true, false] @@ -265,7 +263,7 @@ class Relation < ApplicationRecord private def save_with_history! - t = Time.now.getutc + t = Time.now.utc self.version += 1 self.timestamp = t