module Tableless::Persistence
Public Instance Methods
destroy()
click to toggle source
# File lib/tableless/persistence.rb, line 26 def destroy @_trigger_destroy_callback = true @destroyed = true reload and freeze end
reload(*)
click to toggle source
# File lib/tableless/persistence.rb, line 15 def reload(*) @attributes = self.class.new.instance_variable_get('@attributes') @new_record = false self end
update(attributes)
click to toggle source
# File lib/tableless/persistence.rb, line 21 def update(attributes) assign_attributes(attributes) save end
Private Instance Methods
_create_record(*)
click to toggle source
# File lib/tableless/persistence.rb, line 34 def _create_record(*) @new_record = false true end
_update_record(*)
click to toggle source
# File lib/tableless/persistence.rb, line 39 def _update_record(*) @_trigger_update_callback = true true end