1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test
Dmitry Polushkin e3d99e239d Validate multiple contexts on valid? and invalid? at once.
Example:

```ruby
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.errors.messages               # => {:name=>["can't be blank"], :title=>["can't be blank"]}
```
2015-09-07 22:42:50 +01:00
..
cases Validate multiple contexts on valid? and invalid? at once. 2015-09-07 22:42:50 +01:00
models Remove XML Serialization from core. 2015-08-07 11:01:48 -04:00
validators This is not an executable file 2010-12-16 01:49:28 +05:30