cheat sheets.

$ cheat callbacks
Regular callbacks in ActiveRecord::Base

  1.  before_create
  2.  after_create

  3.  before_validation
  4.  before_validation_on_create
  5.  after_validation
  6.  after_validation_on_create
  7.  before_save
  8.  before_create
  9.  after_create
  10. after_save

  11. before_destroy
  12. after_destroy

Usage

  class Foo < ActiveRecord::Base
    before_create :do_stuff
  end

Exceptions

  * after_find
  * after_initialize 

Usage

  class Foo < ActiveRecord::Base
    def after_find
      do_stuff
    end
  end
Version 1, updated 835 days ago.
. o 0 ( | history | revert to | current | diff )
( add new | see all )