好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

http://api.rubyonrails.org/classes/ActiveRecord/Ca

http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html

Active Record Callbacks

Callbacks are hooks into the life cycle of an Active Record object that allow you to trigger logic before or after an alteration of the object state. This can be used to make sure that associated and dependent objects are deleted when destroy is called (by overwriting before_destroy ) or to massage attributes before they’re validated (by overwriting before_validation ). As an example of the callbacks initiated, consider the Base#save call for a new record:

(-) save

(-) valid

(1) before_validation

(-) validate

(2) after_validation

(3) before_save

(4) before_create

(-) create

(5) after_create

(6) after_save

(7) after_commit

http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html

查看更多关于http://api.rubyonrails.org/classes/ActiveRecord/Ca的详细内容...

  阅读:36次

上一篇: *taobao

下一篇:rails 安装路径