rails/rails — pull request #10287 by neerajdotname (2013-04-21 17:40:26+00:00)
Title: Obey validation rules on: :save condition

class User < ActiveRecord::Base
validates :name, presence: true, on: :save
end

In at the above case `User.new.valid?` returns true. Also while
updating user can set `name` value to `nil` and no validation
error is found while saving the record.

Active Model understands validations in either `:create` or
`:update` context. Otherwise it is best to not set any context.
And that's what this fix is attempting to do.

It removes context if context is `:save`.

fixes #10248