Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7kamura/80a7b565abc2081cca48 to your computer and use it in GitHub Desktop.
Save r7kamura/80a7b565abc2081cca48 to your computer and use it in GitHub Desktop.
scope :active, -> { not.expired.not.revoked }
scope :expired, -> { where('accessed_at < ?', 1.year.ago) }
scope :revoked, -> { where.not(revoked_at: nil) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment