Sha256: 64b1b390c63a748df4514aa1fb2a6628f4bf527b778c2bdb1cbc62af496c5a51
Contents?: true
Size: 1.09 KB
Versions: 9
Compression:
Stored size: 1.09 KB
Contents
module Volt module Persistors # Implements the base persistor functionality. class Base def initialize(model) @model = model end def loaded(initial_state = nil) @model.change_state_to(:loaded_state, initial_state || :loaded) end def changed(attribute_name) end def added(model, index) end # For removed, the default action is to call changed for it def removed(attribute_name) changed(attribute_name) end # Called when the model is cleared (all child models removed) def clear end def event_added(event, first, first_for_event) end def event_removed(event, last, last_for_event) end # Specify if this collection should auto-generate id's def auto_generate_id false end # Find the root for this model def root_model node = @model loop do parent = node.parent if parent node = parent else break end end node end end end end
Version data entries
9 entries across 9 versions & 1 rubygems