mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #21556 from artofhuman/master
Fix typo in activemodel changelog [ci skip]
This commit is contained in:
commit
997acb9aad
1 changed files with 4 additions and 4 deletions
|
@ -1,17 +1,17 @@
|
|||
* Validate multiple contexts on `valid?` and `invalid?` at once.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
class Person
|
||||
include ActiveModel::Validations
|
||||
|
||||
|
||||
attr_reader :name, :title
|
||||
validates_presence_of :name, on: :create
|
||||
validates_presence_of :title, on: :update
|
||||
end
|
||||
|
||||
|
||||
person = Person.new
|
||||
person.valid?([:create, :update]) # => true
|
||||
person.valid?([:create, :update]) # => false
|
||||
person.errors.messages # => {:name=>["can't be blank"], :title=>["can't be blank"]}
|
||||
|
||||
*Dmitry Polushkin*
|
||||
|
|
Loading…
Reference in a new issue