mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix ActiveSupport::Callbacks' define_callbacks and ActiveSupport::Concern documentation to look like native English
This commit is contained in:
parent
d191db76e0
commit
f544c0a32d
2 changed files with 11 additions and 11 deletions
|
@ -568,9 +568,9 @@ module ActiveSupport
|
|||
#
|
||||
# would trigger <tt>Audit#before_save</tt> instead. That's constructed by calling
|
||||
# <tt>"#{kind}_#{name}"</tt> on the given instance. In this case "kind" is "before" and
|
||||
# "name" is "save". In this context treat ":kind" and ":name" as special thing where
|
||||
# ":kind" refers to "callback type(before/after)" and ":name" refers to the method on
|
||||
# which callbacks are being defined.
|
||||
# "name" is "save". In this context ":kind" and ":name" have special meanings: ":kind"
|
||||
# refers to the kind of callback (before/after/around) and ":name" refers to the
|
||||
# method on which callbacks are being defined.
|
||||
#
|
||||
# A declaration like
|
||||
#
|
||||
|
|
|
@ -4,33 +4,33 @@
|
|||
# def self.included(base)
|
||||
# base.send(:extend, ClassMethods)
|
||||
# base.send(:include, InstanceMethods)
|
||||
# scope :foo, :conditions => {:created_at => nil}
|
||||
# scope :foo, :conditions => { :created_at => nil }
|
||||
# end
|
||||
#
|
||||
# module ClassMethods
|
||||
# def cm; puts 'I am class method'; end
|
||||
# def cm; puts 'I am a class method'; end
|
||||
# end
|
||||
#
|
||||
# module InstanceMethods
|
||||
# def im; puts 'I am instance method'; end
|
||||
# def im; puts 'I am an instance method'; end
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# By using <tt>ActiveSupport::Concern</tt> above module could be written as:
|
||||
# By using <tt>ActiveSupport::Concern</tt> the above module could instead be written as:
|
||||
#
|
||||
# module M
|
||||
# extend ActiveSupport::Concern
|
||||
#
|
||||
# included do
|
||||
# scope :foo, :conditions => {:created_at => nil}
|
||||
# included do
|
||||
# scope :foo, :conditions => { :created_at => nil }
|
||||
# end
|
||||
#
|
||||
# module ClassMethods
|
||||
# def cm; puts 'I am class method'; end
|
||||
# def cm; puts 'I am a class method'; end
|
||||
# end
|
||||
#
|
||||
# module InstanceMethods
|
||||
# def im; puts 'I am instance method'; end
|
||||
# def im; puts 'I am an instance method'; end
|
||||
# end
|
||||
# end
|
||||
module ActiveSupport
|
||||
|
|
Loading…
Reference in a new issue