提交 716c243d 编写于 作者: R Rizwan Reza

Minor changes to active_model/callbacks.rb and dirty.rb

上级 97d6778c
......@@ -2,7 +2,7 @@
require 'active_support/callbacks'
module ActiveModel
# == Active Model Callbacks
# == Active Model Call Backs
#
# Provides an interface for any class to have Active Record like callbacks.
#
......
......@@ -4,16 +4,21 @@
require 'active_support/core_ext/object/duplicable'
module ActiveModel
# <tt>ActiveModel::Dirty</tt> provides a way to track changes in your
# object in the same way as ActiveRecord does.
# == Active Model Call Backs
#
# Provides a way to track changes in your object in the same way as
# Active Record does.
#
# The requirements to implement ActiveModel::Dirty are:
# The requirements to implement ActiveModel::Dirty are to:
#
# * <tt>include ActiveModel::Dirty</tt> in your object
# * Call <tt>define_attribute_methods</tt> passing each method you want to track
# * Call <tt>attr_name_will_change!</tt> before each change to the tracked attribute
# * Call <tt>define_attribute_methods</tt> passing each method you want to
# track
# * Call <tt>attr_name_will_change!</tt> before each change to the tracked
# attribute
#
# If you wish to also track previous changes on save or update, you need to add
# If you wish to also track previous changes on save or update, you need to
# add
#
# @previously_changed = changes
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册