Skip to content

Commit

Permalink
Merge pull request #47022 from zzak/callbacks-links-continued
Browse files Browse the repository at this point in the history
Fix more links for callbacks
  • Loading branch information
rafaelfranca committed Jan 16, 2023
2 parents d994f79 + ae8ca66 commit a52596c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions activemodel/lib/active_model/callbacks.rb
Expand Up @@ -11,7 +11,7 @@ module ActiveModel
# Like the Active Record methods, the callback chain is aborted as soon as
# one of the methods throws +:abort+.
#
# First, extend ActiveModel::Callbacks from the class you are creating:
# First, extend <tt>ActiveModel::Callbacks</tt> from the class you are creating:
#
# class MyModel
# extend ActiveModel::Callbacks
Expand Down Expand Up @@ -69,15 +69,15 @@ def self.extended(base) # :nodoc:
end
end

# define_model_callbacks accepts the same options +define_callbacks+ does,
# +define_model_callbacks+ accepts the same options +define_callbacks+ does,
# in case you want to overwrite a default. Besides that, it also accepts an
# <tt>:only</tt> option, where you can choose if you want all types (before,
# around or after) or just some.
#
# define_model_callbacks :initialize, only: :after
#
# Note, the <tt>only: <type></tt> hash will apply to all callbacks defined
# on that method call. To get around this you can call the define_model_callbacks
# on that method call. To get around this you can call the +define_model_callbacks+
# method as many times as you need.
#
# define_model_callbacks :create, only: :after
Expand All @@ -104,7 +104,7 @@ def self.extended(base) # :nodoc:
# end
# end
#
# NOTE: +method_name+ passed to define_model_callbacks must not end with
# NOTE: +method_name+ passed to +define_model_callbacks+ must not end with
# <tt>!</tt>, <tt>?</tt> or <tt>=</tt>.
def define_model_callbacks(*callbacks)
options = callbacks.extract_options!
Expand Down
6 changes: 3 additions & 3 deletions activemodel/lib/active_model/validations/callbacks.rb
Expand Up @@ -4,10 +4,10 @@ module ActiveModel
module Validations
# == Active \Model \Validation \Callbacks
#
# Provides an interface for any class to have +before_validation+ and
# +after_validation+ callbacks.
# Provides an interface for any class to have ClassMethods#before_validation and
# ClassMethods#after_validation callbacks.
#
# First, include ActiveModel::Validations::Callbacks from the class you are
# First, include <tt>ActiveModel::Validations::Callbacks</tt> from the class you are
# creating:
#
# class MyModel
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/callbacks.rb
Expand Up @@ -84,7 +84,7 @@ module ActiveRecord
# == Types of callbacks
#
# There are three types of callbacks accepted by the callback macros: method references (symbol), callback objects,
# inline methods (using a proc). Method references and callback objects are the recommended approaches,
# inline methods (using a proc). \Method references and callback objects are the recommended approaches,
# inline methods using a proc are sometimes appropriate (such as for creating mix-ins).
#
# The method reference callbacks work by specifying a protected or private method available in the object, like this:
Expand Down Expand Up @@ -173,7 +173,7 @@ module ActiveRecord
#
# If a <tt>before_*</tt> callback throws +:abort+, all the later callbacks and
# the associated action are cancelled.
# Callbacks are generally run in the order they are defined, with the exception of callbacks defined as
# \Callbacks are generally run in the order they are defined, with the exception of callbacks defined as
# methods on the model, which are called last.
#
# == Ordering callbacks
Expand Down

0 comments on commit a52596c

Please sign in to comment.