Module: Sequel::Plugins::Composition::InstanceMethods
- Defined in:
- lib/sequel/plugins/composition.rb
Instance Method Summary collapse
- 
  
    
      #before_validation  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    For each composition, set the columns in the model class based on the composition object. 
- 
  
    
      #compositions  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Cache of composition objects for this class. 
- 
  
    
      #freeze  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Freeze compositions hash when freezing model instance. 
Instance Method Details
#before_validation ⇒ Object
For each composition, set the columns in the model class based on the composition object.
| 182 183 184 185 186 | # File 'lib/sequel/plugins/composition.rb', line 182 def before_validation # decomposer_method is private @compositions.keys.each{|n| send(model.compositions[n][:decomposer_method])} if @compositions super end | 
#compositions ⇒ Object
Cache of composition objects for this class.
| 168 169 170 | # File 'lib/sequel/plugins/composition.rb', line 168 def compositions @compositions ||= {} end | 
#freeze ⇒ Object
Freeze compositions hash when freezing model instance.
| 173 174 175 176 177 178 | # File 'lib/sequel/plugins/composition.rb', line 173 def freeze compositions super compositions.freeze self end |