Skip to content

Commit 707f252

Browse files
authored
Merge pull request rails#44782 from p8/activemodel/remove-confusing-line-from-validations-docs
Remove confusing validations comments [ci-skip]
2 parents 888ea75 + 8e91abb commit 707f252

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

activemodel/lib/active_model/validations/absence.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def validate_each(record, attr_name, value)
1111

1212
module HelperMethods
1313
# Validates that the specified attributes are blank (as defined by
14-
# Object#present?). Happens by default on save.
14+
# Object#present?).
1515
#
1616
# class Person < ActiveRecord::Base
1717
# validates_absence_of :first_name

activemodel/lib/active_model/validations/acceptance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module HelperMethods
9090
#
9191
# If the database column does not exist, the +terms_of_service+ attribute
9292
# is entirely virtual. This check is performed only if +terms_of_service+
93-
# is not +nil+ and by default on save.
93+
# is not +nil+.
9494
#
9595
# Configuration options:
9696
# * <tt>:message</tt> - A custom error message (default is: "must be

activemodel/lib/active_model/validations/presence.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def validate_each(record, attr_name, value)
1010

1111
module HelperMethods
1212
# Validates that the specified attributes are not blank (as defined by
13-
# Object#blank?). Happens by default on save.
13+
# Object#blank?).
1414
#
1515
# class Person < ActiveRecord::Base
1616
# validates_presence_of :first_name

activerecord/lib/active_record/validations.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ def initialize(record = nil)
3030

3131
# = Active Record \Validations
3232
#
33-
# Active Record includes the majority of its validations from ActiveModel::Validations
34-
# all of which accept the <tt>:on</tt> argument to define the context where the
35-
# validations are active. Active Record will always supply either the context of
36-
# <tt>:create</tt> or <tt>:update</tt> dependent on whether the model is a
33+
# Active Record includes the majority of its validations from ActiveModel::Validations.
34+
#
35+
# In Active Record, all validations are performed on save by default.
36+
# Validations accept the <tt>:on</tt> argument to define the context where
37+
# the validations are active. Active Record will pass either the context of
38+
# <tt>:create</tt> or <tt>:update</tt> depending on whether the model is a
3739
# {new_record?}[rdoc-ref:Persistence#new_record?].
3840
module Validations
3941
extend ActiveSupport::Concern

0 commit comments

Comments
 (0)