提交 6dccceef 编写于 作者: J Jon Moss 提交者: GitHub

Merge pull request #28026 from Sen-Zhang/fix_some_typos_in_comments

Change ActiveModel::Validation to ActiveModel::Validations in comments
...@@ -22,7 +22,7 @@ module HelperMethods ...@@ -22,7 +22,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_absence_of(*attr_names) def validates_absence_of(*attr_names)
validates_with AbsenceValidator, _merge_attributes(attr_names) validates_with AbsenceValidator, _merge_attributes(attr_names)
end end
......
...@@ -95,7 +95,7 @@ module HelperMethods ...@@ -95,7 +95,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information. # See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_acceptance_of(*attr_names) def validates_acceptance_of(*attr_names)
validates_with AcceptanceValidator, _merge_attributes(attr_names) validates_with AcceptanceValidator, _merge_attributes(attr_names)
end end
......
...@@ -69,7 +69,7 @@ module HelperMethods ...@@ -69,7 +69,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_confirmation_of(*attr_names) def validates_confirmation_of(*attr_names)
validates_with ConfirmationValidator, _merge_attributes(attr_names) validates_with ConfirmationValidator, _merge_attributes(attr_names)
end end
......
...@@ -38,7 +38,7 @@ module HelperMethods ...@@ -38,7 +38,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_exclusion_of(*attr_names) def validates_exclusion_of(*attr_names)
validates_with ExclusionValidator, _merge_attributes(attr_names) validates_with ExclusionValidator, _merge_attributes(attr_names)
end end
......
...@@ -104,7 +104,7 @@ module HelperMethods ...@@ -104,7 +104,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_format_of(*attr_names) def validates_format_of(*attr_names)
validates_with FormatValidator, _merge_attributes(attr_names) validates_with FormatValidator, _merge_attributes(attr_names)
end end
......
...@@ -36,7 +36,7 @@ module HelperMethods ...@@ -36,7 +36,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_inclusion_of(*attr_names) def validates_inclusion_of(*attr_names)
validates_with InclusionValidator, _merge_attributes(attr_names) validates_with InclusionValidator, _merge_attributes(attr_names)
end end
......
...@@ -110,7 +110,7 @@ module HelperMethods ...@@ -110,7 +110,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+ and +:strict+. # +:if+, +:unless+, +:on+ and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_length_of(*attr_names) def validates_length_of(*attr_names)
validates_with LengthValidator, _merge_attributes(attr_names) validates_with LengthValidator, _merge_attributes(attr_names)
end end
......
...@@ -134,7 +134,7 @@ module HelperMethods ...@@ -134,7 +134,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ . # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ .
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
# #
# The following checks can also be supplied with a proc or a symbol which # The following checks can also be supplied with a proc or a symbol which
# corresponds to a method: # corresponds to a method:
......
...@@ -29,7 +29,7 @@ module HelperMethods ...@@ -29,7 +29,7 @@ module HelperMethods
# #
# There is also a list of default options supported by every validator: # There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validation#validates</tt> for more information # See <tt>ActiveModel::Validations#validates</tt> for more information
def validates_presence_of(*attr_names) def validates_presence_of(*attr_names)
validates_with PresenceValidator, _merge_attributes(attr_names) validates_with PresenceValidator, _merge_attributes(attr_names)
end end
......
...@@ -61,7 +61,7 @@ module ClassMethods ...@@ -61,7 +61,7 @@ module ClassMethods
# The method, proc or string should return or evaluate to a +true+ or # The method, proc or string should return or evaluate to a +true+ or
# +false+ value. # +false+ value.
# * <tt>:strict</tt> - Specifies whether validation should be strict. # * <tt>:strict</tt> - Specifies whether validation should be strict.
# See <tt>ActiveModel::Validation#validates!</tt> for more information. # See <tt>ActiveModel::Validations#validates!</tt> for more information.
# #
# If you pass any additional configuration options, they will be passed # If you pass any additional configuration options, they will be passed
# to the class and available as +options+: # to the class and available as +options+:
......
...@@ -57,7 +57,7 @@ module ClassMethods ...@@ -57,7 +57,7 @@ module ClassMethods
# or <tt>unless: Proc.new { |user| user.signup_step <= 2 }</tt>). The method, # or <tt>unless: Proc.new { |user| user.signup_step <= 2 }</tt>). The method,
# proc or string should return or evaluate to a +true+ or +false+ value. # proc or string should return or evaluate to a +true+ or +false+ value.
# * <tt>:strict</tt> - Specifies whether validation should be strict. # * <tt>:strict</tt> - Specifies whether validation should be strict.
# See ActiveModel::Validation#validates! for more information. # See ActiveModel::Validations#validates! for more information.
def validates_presence_of(*attr_names) def validates_presence_of(*attr_names)
validates_with PresenceValidator, _merge_attributes(attr_names) validates_with PresenceValidator, _merge_attributes(attr_names)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册