Update user avatar in LDAP
This commit is contained in:
@@ -10,9 +10,9 @@ class User < ApplicationRecord
|
||||
#
|
||||
|
||||
has_one_attached :avatar do |attachable|
|
||||
attachable.variant :small, resize_to_fill: [64, 64]
|
||||
attachable.variant :medium, resize_to_fill: [256, 256]
|
||||
attachable.variant :large, resize_to_fill: [512, 512]
|
||||
attachable.variant :small, resize_to_fill: [64, 64], convert: :jpeg
|
||||
attachable.variant :medium, resize_to_fill: [256, 256], convert: :jpeg
|
||||
attachable.variant :large, resize_to_fill: [512, 512], convert: :jpeg
|
||||
end
|
||||
|
||||
#
|
||||
@@ -167,6 +167,11 @@ class User < ApplicationRecord
|
||||
@display_name ||= ldap_entry[:display_name]
|
||||
end
|
||||
|
||||
|
||||
def avatar_base64(variant: :large)
|
||||
Base64.strict_encode64 avatar.variant(variant).processed.download
|
||||
end
|
||||
|
||||
def services_enabled
|
||||
ldap_entry[:service] || []
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user