mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							22 lines
						
					
					
						
							561 B
						
					
					
				
			
		
		
	
	
							22 lines
						
					
					
						
							561 B
						
					
					
				| # 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
 | |
| 
 | |
|   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
 | |
| end
 |