]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node_tag.rb
Replace composite_primary_keys with rails builtin support
[rails.git] / app / models / old_node_tag.rb
index c710e48f133db67436fbe0b86ff9f94ce4c2a9ea..8f632a6713a04eccc5bc8c1bb8873e8b42698b16 100644 (file)
@@ -9,14 +9,13 @@
 #
 # Foreign Keys
 #
-#  node_tags_id_fkey  (node_id => nodes.node_id)
+#  node_tags_id_fkey  (["node_id", "version"] => nodes.["node_id", "version"])
 #
 
 class OldNodeTag < ApplicationRecord
   self.table_name = "node_tags"
-  self.primary_keys = "node_id", "version", "k"
 
-  belongs_to :old_node, :foreign_key => [:node_id, :version], :inverse_of => :old_tags
+  belongs_to :old_node, :query_constraints => [:node_id, :version], :inverse_of => :old_tags
 
   validates :old_node, :associated => true
   validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true