Module: Tableless::Persistence
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/tableless/persistence.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
28 29 30 31 32 |
# File 'lib/tableless/persistence.rb', line 28 def destroy @_trigger_destroy_callback = true @destroyed = true reload and freeze end |
#reload ⇒ Object
17 18 19 20 21 |
# File 'lib/tableless/persistence.rb', line 17 def reload(*) @attributes = self.class.new.instance_variable_get(:@attributes) @new_record = false self end |
#update(attributes) ⇒ Object
23 24 25 26 |
# File 'lib/tableless/persistence.rb', line 23 def update(attributes) assign_attributes(attributes) save end |