diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-02 19:11:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-02 19:11:17 +0100 |
commit | d9e30efa5ecc87bc9be7b2e28baaf34bd01032f5 (patch) | |
tree | a2bb52cd8418feb062b908dfaf98d00a3c0ccbbe /app/lib/application_extension.rb | |
parent | 0b8fe020b599341d78cc03431eb156485c70ebea (diff) | |
parent | 78781793d5ab370829d7eaee4b8d21994f84763c (diff) |
Merge pull request #1709 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/application_extension.rb')
-rw-r--r-- | app/lib/application_extension.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/lib/application_extension.rb b/app/lib/application_extension.rb index e61cd0721..a1fea6430 100644 --- a/app/lib/application_extension.rb +++ b/app/lib/application_extension.rb @@ -8,4 +8,8 @@ module ApplicationExtension validates :website, url: true, length: { maximum: 2_000 }, if: :website? validates :redirect_uri, length: { maximum: 2_000 } end + + def most_recently_used_access_token + @most_recently_used_access_token ||= access_tokens.where.not(last_used_at: nil).order(last_used_at: :desc).first + end end |