Module: Lore::Aspect

Included in:
Model, Table_Accessor
Defined in:
lib/lore/model/aspect.rb

Overview

Steps taken in .create are:

  • .before_create(attribs)

  • applying input filters

  • .before_create_after_filters(attribs)

  • distributing attributes to tables:

    { :attrib => 'value' } -> { 'public.my_table' => { :attrib => 'value'} }
    
  • .before_create_and_validation(table_attribs)

  • validation

  • .before_insert(table_attribs)

  • insert operation

  • .before_load(attribs)

  • load new instance from DB (thus getting final table values)

  • .after_create(created_instance)

Instance Method Summary collapse

Instance Method Details

#after_commit(obj) ⇒ Object

Expects updated object.



75
76
# File 'lib/lore/model/aspect.rb', line 75

def after_commit(obj)
end

#after_instance_delete(model_instance) ⇒ Object

Expects model instance table rows have been deleted of



66
67
# File 'lib/lore/model/aspect.rb', line 66

def after_instance_delete(model_instance)
end

#before_commit(obj) ⇒ Object

Expects arguments (value hash) passed to Table_Accessor.create and object to be updated.



72
73
# File 'lib/lore/model/aspect.rb', line 72

def before_commit(obj)
end

#before_instance_delete(model_instance) ⇒ Object

Expects model instance to be deleted.



62
63
# File 'lib/lore/model/aspect.rb', line 62

def before_instance_delete(model_instance)
end