Module: Cequel::Model::Callbacks
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/cequel/model/callbacks.rb
Constant Summary collapse
- HOOKS =
[:save, :create, :update, :destroy, :validation]
- CALLBACKS =
HOOKS.map { |hook| [:"before_#{hook}", :"after_#{hook}"] }. flatten
Instance Method Summary collapse
Instance Method Details
#destroy(*args) ⇒ Object
24 25 26 |
# File 'lib/cequel/model/callbacks.rb', line 24 def destroy(*args) run_callbacks(:destroy) { super } end |
#save(*args) ⇒ Object
18 19 20 21 22 |
# File 'lib/cequel/model/callbacks.rb', line 18 def save(*args) run_callbacks(:save) do run_callbacks(persisted? ? :update : :create) { super } end end |