instance method save_with_validation

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available 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_validation opt = true
Source
# File activerecord/lib/active_record/validations.rb, line 1087
    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 1087 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Validations

Type at least 2 characters to search.

↑↓ navigate · open · esc close