X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8938ab79975d4152a4d6d3c8ceafdbda30b6b367..29432d5e9fc8d2c7877bacaf08d58502bb682a33:/app/models/way.rb?ds=sidebyside diff --git a/app/models/way.rb b/app/models/way.rb index 767289d58..2a989f9f3 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -27,9 +27,9 @@ class Way < ApplicationRecord belongs_to :changeset - has_many :old_ways, -> { order(:version) } + has_many :old_ways, -> { order(:version) }, :inverse_of => :current_way - has_many :way_nodes, -> { order(:sequence_id) } + has_many :way_nodes, -> { order(:sequence_id) }, :inverse_of => :way has_many :nodes, :through => :way_nodes has_many :way_tags @@ -155,7 +155,7 @@ class Way < ApplicationRecord end def create_with_history(user) - check_create_consistency(self, user) + check_create_element_consistency(self, user) raise OSM::APIPreconditionFailedError, "Cannot create way: data is invalid." unless preconditions_ok? self.version = 0 @@ -227,7 +227,7 @@ class Way < ApplicationRecord private def save_with_history! - t = Time.now.getutc + t = Time.now.utc self.version += 1 self.timestamp = t