Module: Sequel::Plugins::Composition::InstanceMethods
- Defined in:
- lib/sequel/plugins/composition.rb
Instance Method Summary collapse
-
#_refresh(ds) ⇒ Object
Clear the cached compositions when refreshing.
-
#before_save ⇒ 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.
Instance Method Details
#_refresh(ds) ⇒ Object
Clear the cached compositions when refreshing.
118 119 120 121 122 |
# File 'lib/sequel/plugins/composition.rb', line 118 def _refresh(ds) v = super compositions.clear v end |
#before_save ⇒ Object
For each composition, set the columns in the model class based on the composition object.
126 127 128 129 |
# File 'lib/sequel/plugins/composition.rb', line 126 def before_save @compositions.keys.each{|n| instance_eval(&model.compositions[n][:decomposer])} if @compositions super end |
#compositions ⇒ Object
Cache of composition objects for this class.
132 133 134 |
# File 'lib/sequel/plugins/composition.rb', line 132 def compositions @compositions ||= {} end |