2023-09-22 21:50:39 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
module UserConfigs
|
|
|
|
|
module_function
|
|
|
|
|
|
|
|
|
|
def load_signature(user)
|
|
|
|
|
return if user.blank?
|
|
|
|
|
|
|
|
|
|
uuid = user.user_configs.find_or_initialize_by(key: UserConfig::SIGNATURE_KEY).value
|
|
|
|
|
|
|
|
|
|
ActiveStorage::Attachment.find_by(uuid:, record: user, name: 'signature') if uuid.present?
|
|
|
|
|
end
|
2024-06-02 17:06:09 +03:00
|
|
|
|
|
|
|
|
def load_initials(user)
|
|
|
|
|
return if user.blank?
|
|
|
|
|
|
|
|
|
|
uuid = user.user_configs.find_or_initialize_by(key: UserConfig::INITIALS_KEY).value
|
|
|
|
|
|
|
|
|
|
ActiveStorage::Attachment.find_by(uuid:, record: user, name: 'initials') if uuid.present?
|
|
|
|
|
end
|
2023-09-22 21:50:39 +03:00
|
|
|
end
|