Last active
September 2, 2015 07:16
-
-
Save r7kamura/80a7b565abc2081cca48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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