Skip to content

redradiant/suppress_validations

 
 

Repository files navigation

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

About

A Rails plugin that let's you temporarily suppress ActiveRecord validations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published