]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Add inverse_of to relationships that can't detect it automatically
[rails.git] / app / models / relation.rb
index 4200a08dd7c709da827e405759c7d5df968a5672..61ae45c99d24b65512ce480c55b70ad7dc9a81da 100644 (file)
@@ -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