Sha256: 295bd2db3cd502d390dffc348d82aeab621e14fb2e4a0e2f9b892acb7cd8e943

Contents?: true

Size: 642 Bytes

Versions: 69

Compression:

Stored size: 642 Bytes

Contents

module ActionController
  module Assertions
    module ModelAssertions
      # Ensures that the passed record is valid by Active Record standards and
      # returns any error messages if it is not.
      #
      # ==== Examples
      #
      #   # assert that a newly created record is valid
      #   model = Model.new
      #   assert_valid(model)
      #
      def assert_valid(record)
        ::ActiveSupport::Deprecation.warn("assert_valid is deprecated. Use assert record.valid? instead", caller)
        clean_backtrace do
          assert record.valid?, record.errors.full_messages.join("\n")
        end
      end
    end
  end
end

Version data entries

69 entries across 68 versions & 14 rubygems

Version Path
actionpack-2.3.18 lib/action_controller/assertions/model_assertions.rb
actionpack_csi-2.3.5.p8 lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.17-rack-upgrade-2.3.17 lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.17 lib/action_controller/assertions/model_assertions.rb
actionpack_csi-2.3.5.p7 lib/action_controller/assertions/model_assertions.rb
actionpack_csi-2.3.5.p6 lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.16 lib/action_controller/assertions/model_assertions.rb
actionpack-rack-upgrade-2-2.3.16 lib/action_controller/assertions/model_assertions.rb
actionpack-rack-upgrade-2-2.3.15 lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.15 lib/action_controller/assertions/model_assertions.rb
actionpack-rack-upgrade-2.3.16 lib/action_controller/assertions/model_assertions.rb
actionpack-rack-upgrade-2.3.15 lib/action_controller/assertions/model_assertions.rb
actionpack-rack-upgrade-2.3.14 lib/action_controller/assertions/model_assertions.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/assertions/model_assertions.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/actionpack-2.3.12/lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.14 lib/action_controller/assertions/model_assertions.rb
kajam-1.0.3.rc2 vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb
actionpack-2.3.12 lib/action_controller/assertions/model_assertions.rb
radiant-1.0.0.rc2 vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb
radiant-1.0.0.rc1 vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb