Module: Sequel::Plugins::Composition::InstanceMethods
- Defined in:
- lib/sequel/plugins/composition.rb
Instance Method Summary (collapse)
-
- (Object) _refresh(ds)
Clear the cached compositions when refreshing.
-
- (Object) before_save
For each composition, set the columns in the model class based on the composition object.
-
- (Object) compositions
Cache of composition objects for this class.
Instance Method Details
- (Object) _refresh(ds)
Clear the cached compositions when refreshing.
152 153 154 155 156 |
# File 'lib/sequel/plugins/composition.rb', line 152 def _refresh(ds) v = super compositions.clear v end |
- (Object) before_save
For each composition, set the columns in the model class based on the composition object.
160 161 162 163 |
# File 'lib/sequel/plugins/composition.rb', line 160 def before_save @compositions.keys.each{|n| instance_eval(&model.compositions[n][:decomposer])} if @compositions super end |
- (Object) compositions
Cache of composition objects for this class.
166 167 168 |
# File 'lib/sequel/plugins/composition.rb', line 166 def compositions @compositions ||= {} end |