]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
Add inverse_of to relationships that can't detect it automatically
[rails.git] / app / models / way.rb
index 933cb7c8b81a5bc6a7e29c3e49ac5b16b6f09fd2..0c6e645b7e2ce40f89bf81ca2002a5c056550cf2 100644 (file)
@@ -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