mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
e3d99e239d
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"]} ``` |
||
---|---|---|
.. | ||
active_model | ||
active_model.rb |