Module: MemoryModel::Base::Actions
- Extended by:
- ActiveSupport::Autoload, ActiveSupport::Concern
- Included in:
- MemoryModel::Base
- Defined in:
- lib/memory_model/base/actions.rb,
lib/memory_model/base/actions/class_methods.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- VALID_IVARS =
[ :@attributes ]
Instance Method Summary collapse
Instance Method Details
#delete ⇒ Object
29 30 31 32 |
# File 'lib/memory_model/base/actions.rb', line 29 def delete self.class.collection.delete(self) freeze end |
#destroy ⇒ Object
34 35 36 37 38 |
# File 'lib/memory_model/base/actions.rb', line 34 def destroy run_callbacks :destroy do delete end end |
#save(options = {}) ⇒ Object
40 41 42 |
# File 'lib/memory_model/base/actions.rb', line 40 def save(={}) !!perform_validations() ? commit : false end |
#save!(options = {}) ⇒ Object
44 45 46 |
# File 'lib/memory_model/base/actions.rb', line 44 def save!(={}) !!perform_validations() ? commit : raise(RecordInvalid.new(self)) end |