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.
176 177 178 179 180 |
# File 'lib/sequel/plugins/composition.rb', line 176 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.
164 165 166 |
# File 'lib/sequel/plugins/composition.rb', line 164 def compositions @compositions ||= {} end |
#freeze ⇒ Object
Freeze compositions hash when freezing model instance.
169 170 171 172 |
# File 'lib/sequel/plugins/composition.rb', line 169 def freeze compositions.freeze super end |