mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-03-14 22:25:17 +09:00
18 lines
271 B
Ruby
18 lines
271 B
Ruby
module User::Avatar
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_one_attached :avatar
|
|
end
|
|
|
|
class_methods do
|
|
def from_avatar_token(sid)
|
|
find_signed!(sid, purpose: :avatar)
|
|
end
|
|
end
|
|
|
|
def avatar_token
|
|
signed_id(purpose: :avatar)
|
|
end
|
|
end
|