debian-mirror-gitlab/app/models/concerns/closed_at_filterable.rb
2019-07-07 11:18:12 +05:30

15 lines
347 B
Ruby

# frozen_string_literal: true
module ClosedAtFilterable
extend ActiveSupport::Concern
included do
scope :closed_before, ->(date) { where(scoped_table[:closed_at].lteq(date)) }
scope :closed_after, ->(date) { where(scoped_table[:closed_at].gteq(date)) }
def self.scoped_table
arel_table.alias(table_name)
end
end
end