Change user settings to be stored in a more optimal way (#23630)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		
							
								
								
									
										23
									
								
								app/models/user_settings/glue.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								app/models/user_settings/glue.rb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
module UserSettings::Glue
 | 
			
		||||
  def to_model
 | 
			
		||||
    self
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def to_key
 | 
			
		||||
    ''
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def persisted?
 | 
			
		||||
    false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def type_for_attribute(key)
 | 
			
		||||
    self.class.definition_for(key)&.type
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def has_attribute?(key) # rubocop:disable Naming/PredicateName
 | 
			
		||||
    self.class.definition_for?(key)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user