Commit f2d1e645 authored by Eugen Rochko's avatar Eugen Rochko

Display and use latest connection

parent 5ee81951
class Authorization < ApplicationRecord
belongs_to :user, inverse_of: :authorizations
default_scope { order('id asc') }
end
......@@ -4,11 +4,11 @@ class User < ApplicationRecord
has_many :authorizations
def twitter
@twitter ||= authorizations.find_by(provider: :twitter)
@twitter ||= authorizations.where(provider: :twitter).last
end
def mastodon
@mastodon ||= authorizations.find_by(provider: :mastodon)
@mastodon ||= authorizations.where(provider: :mastodon).last
end
class << self
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment