From a79aad443d0d3a8f132b763c48a19d92a8d9cc90 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 19 Aug 2020 17:04:25 -0500 Subject: [PATCH] tag relationships: fix typo in consequent_wiki association. The consequent_wiki association incorrectly used the antecedent wiki. This caused wiki conflict errors when approving aliases. --- app/models/tag_relationship.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tag_relationship.rb b/app/models/tag_relationship.rb index 75d37571a..0afc16ff9 100644 --- a/app/models/tag_relationship.rb +++ b/app/models/tag_relationship.rb @@ -13,7 +13,7 @@ class TagRelationship < ApplicationRecord belongs_to :antecedent_tag, class_name: "Tag", foreign_key: "antecedent_name", primary_key: "name", default: -> { Tag.find_or_create_by_name(antecedent_name) } belongs_to :consequent_tag, class_name: "Tag", foreign_key: "consequent_name", primary_key: "name", default: -> { Tag.find_or_create_by_name(consequent_name) } belongs_to :antecedent_wiki, class_name: "WikiPage", foreign_key: "antecedent_name", primary_key: "title", optional: true - belongs_to :consequent_wiki, class_name: "WikiPage", foreign_key: "antecedent_name", primary_key: "title", optional: true + belongs_to :consequent_wiki, class_name: "WikiPage", foreign_key: "consequent_name", primary_key: "title", optional: true scope :active, -> {approved} scope :approved, -> {where(status: %w[active processing queued])}