mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 16:44:04 -05:00
11 lines
323 B
Ruby
11 lines
323 B
Ruby
# 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
|