Skip to content

Commit

Permalink
Merge pull request #47850 from notapatch/api-docs-activerecord-valida…
Browse files Browse the repository at this point in the history
…te-multiple-contexts

Add docs for Active Record validation with multiple contexts
  • Loading branch information
zzak committed Apr 8, 2023
2 parents a40e934 + 5b25375 commit 97f0c3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions activerecord/lib/active_record/validations.rb
Expand Up @@ -62,6 +62,8 @@ def save!(**options)
#
# If the argument is +false+ (default is +nil+), the context is set to <tt>:create</tt> if
# {new_record?}[rdoc-ref:Persistence#new_record?] is +true+, and to <tt>:update</tt> if it is not.
# If the argument is an array of contexts, <tt>post.valid?([:create, :update])</tt>, the validations are
# run within multiple contexts.
#
# \Validations with no <tt>:on</tt> option will run no matter the context. \Validations with
# some <tt>:on</tt> option will only run in the specified context.
Expand Down

0 comments on commit 97f0c3c

Please sign in to comment.