instance method
save_with_validation
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
save_with_validation(perform_validation = true)
The validation process on save can be skipped by passing false. The regular Base#save method is replaced with this when the validations module is mixed in, which it is by default.
Parameters
-
perform_validationopt = true
Source
# File activerecord/lib/active_record/validations.rb, line 1007
def save_with_validation(perform_validation = true)
if perform_validation && valid? || !perform_validation
save_without_validation
else
false
end
end
Defined in activerecord/lib/active_record/validations.rb line 1007
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Validations