From 0ab2dfc5d2752ec04fc2b31b62326c2a401e4028 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 31 Dec 2018 19:03:01 -0600 Subject: [PATCH] aliases/implications: fix conflicting definitions of active scope. --- app/models/tag_relationship.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/tag_relationship.rb b/app/models/tag_relationship.rb index 95b305d49..b714809a3 100644 --- a/app/models/tag_relationship.rb +++ b/app/models/tag_relationship.rb @@ -15,7 +15,8 @@ class TagRelationship < ApplicationRecord has_one :antecedent_wiki, through: :antecedent_tag, source: :wiki_page has_one :consequent_wiki, through: :consequent_tag, source: :wiki_page - scope :active, ->{where(status: "active")} + scope :active, ->{approved} + scope :approved, ->{where(status: %w[active processing queued])} scope :deleted, ->{where(status: "deleted")} scope :expired, ->{where("created_at < ?", EXPIRY.days.ago)} scope :old, ->{where("created_at >= ? and created_at < ?", EXPIRY.days.ago, EXPIRY_WARNING.days.ago)} @@ -89,10 +90,6 @@ class TagRelationship < ApplicationRecord order(Arel.sql("array_position(array['queued', 'processing', 'pending', 'active', 'deleted', 'retired'], status) NULLS FIRST, antecedent_name, consequent_name")) end - def active - where(status: %w[active processing queued]) - end - def default_order pending_first end