X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5966acc207874f3196a43700cb9306411c77fe47..619ac4c5b2fbdbc610007376ee11e3921e475520:/app/models/old_node.rb?ds=inline diff --git a/app/models/old_node.rb b/app/models/old_node.rb index 81d8e331f..3261c9a0e 100644 --- a/app/models/old_node.rb +++ b/app/models/old_node.rb @@ -46,7 +46,7 @@ class OldNode < ApplicationRecord validate :validate_position belongs_to :changeset - belongs_to :redaction + belongs_to :redaction, :optional => true belongs_to :current_node, :class_name => "Node", :foreign_key => "node_id" has_many :old_tags, :class_name => "OldNodeTag", :foreign_key => [:node_id, :version] @@ -82,7 +82,7 @@ class OldNode < ApplicationRecord end def tags - @tags ||= old_tags.collect { |t| [t.k, t.v] }.to_h + @tags ||= old_tags.to_h { |t| [t.k, t.v] } end attr_writer :tags