We werent using any of the other avatar methods
This commit is contained in:
+2
-1
@@ -1,8 +1,9 @@
|
||||
class User < ApplicationRecord
|
||||
include Accessor, Assignee, Avatar, Role, Transferable
|
||||
include Accessor, Assignee, Role, Transferable
|
||||
|
||||
has_many :sessions, dependent: :destroy
|
||||
has_secure_password validations: false
|
||||
has_one_attached :avatar
|
||||
|
||||
has_many :comments, inverse_of: :creator, dependent: :destroy
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
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
|
||||
Reference in New Issue
Block a user