Module: MotionPrime::ModelAssociationMixin
- Extended by:
- MotionSupport::Concern
- Included in:
- Model
- Defined in:
- motion-prime/models/_association_mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #_bags ⇒ Object
-
#save ⇒ Prime::Model
Saves model and all associations to store.
Instance Method Details
#_bags ⇒ Object
5 6 7 |
# File 'motion-prime/models/_association_mixin.rb', line 5 def _bags @_bags ||= {} end |
#save ⇒ Prime::Model
Saves model and all associations to store.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'motion-prime/models/_association_mixin.rb', line 12 def save _bags.values.each do |bag| bag.store = self.store bag.save end super rescue StoreError => e if Prime.env.development? raise StoreError, e.description end end |