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