X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/53aa7259bb0612eb48a17d0b954ad71ea37d87a4..53817fa9e8d955df0891d156f21b7269b4ed08fc:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index 3214564c8..ad4318487 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -32,7 +32,7 @@ class Node < ApplicationRecord belongs_to :changeset - has_many :old_nodes, -> { order(:version) } + has_many :old_nodes, -> { order(:version) }, :inverse_of => :current_node has_many :way_nodes has_many :ways, :through => :way_nodes @@ -49,8 +49,6 @@ class Node < 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 :latitude, :presence => true, :numericality => { :only_integer => true } validates :longitude, :presence => true, @@ -238,7 +236,7 @@ class Node < ApplicationRecord private def save_with_history! - t = Time.now.getutc + t = Time.now.utc self.version += 1 self.timestamp = t