mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-15 08:48:15 +00:00
9 lines
347 B
Ruby
9 lines
347 B
Ruby
# frozen_string_literal: true
|
|
|
|
class OAuth::AccessGrant < ApplicationRecord
|
|
include ::Doorkeeper::Orm::ActiveRecord::Mixins::AccessGrant
|
|
|
|
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
|