Method: PEROBS::Object#mark_as_modified
- Defined in:
- lib/perobs/Object.rb
#mark_as_modified ⇒ Object
Call this method to manually mark the object as modified. This is necessary if you are using the ‘@’ notation to access instance variables during assignment operations (=, +=, -=, etc.). To avoid having to call this method you can use the self. notation.
@foo = 42 # faster but requires call to mark_as_modified()
self.foo = 42 # somewhat slower
IMPORTANT: If you use @foo = … and forget to call mark_as_modified() your data will only be modified in memory but might not be persisted into the database!
136 137 138 |
# File 'lib/perobs/Object.rb', line 136 def mark_as_modified @store.cache.cache_write(self) end |