Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Rails plugin that let's you temporarily suppress ActiveRecord validations
branch: master

This branch is 4 commits ahead of polly:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rails
tasks
test
.gitignore
MIT-LICENSE
README
Rakefile
install.rb
suppress_validations.gemspec
uninstall.rb

README

SuppressValidations
===================

Allows you to temporarily disable validations for any ActiveRecord object,
mainly intended for use in script/console, though it might possibly be somewhat
usefull in unit tests as well.

Example
=======

class SomeModel < ActiveRecord::Base
  validates_presence_of :some_attribute
end



include SuppressValidations

some_model = SomeModel.new
some_model.save # -> false


suppress_validations do
    some_model.save # -> true
end


Copyright (c) 2009 Patrik Hedman, released under the MIT license
Something went wrong with that request. Please try again.