1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-22 10:38:14 +09:00
mastodon/app/lib/access_grant_extension.rb

11 lines
323 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module AccessGrantExtension
extend ActiveSupport::Concern
included do
scope :expired, -> { where.not(expires_in: nil).where('created_at + MAKE_INTERVAL(secs => expires_in) < NOW()') }
scope :revoked, -> { where.not(revoked_at: nil).where(revoked_at: ...Time.now.utc) }
end
end