module Cards
class BlackListedQuery
class << self
delegate :call, to: :new
end
def initialize(relation = Card.unscoped)
@relation = relation
end
def call
@relation.where "cards.black_listed_at IS NOT NULL"
end
end
end
class Card
scope :black_listed, Cards::BlackListedQuery
end