aliases/implications: fix conflicting definitions of active scope.

This commit is contained in:
evazion
2018-12-31 19:03:01 -06:00
parent 17a5db72a6
commit 0ab2dfc5d2

View File

@@ -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