# NotNaughty 0.6.2

**URL:** <https://www.ruby-forum.com/t/notnaughty-0-6-2/152193>\
**Category:** Ruby\
**Created:** [October 31, 2008, 1:11am UTC](https://www.ruby-forum.com/t/notnaughty-0-6-2/152193 "2008-10-31T01:11:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian\_ASSSSmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/48db29/32.png) [@Florian\_ASSSSmann](https://www.ruby-forum.com/u/Florian_ASSSSmann)\
**Post date:** [October 31, 2008, 1:11am UTC](https://www.ruby-forum.com/t/notnaughty-0-6-2/152193/1 "2008-10-31T01:11:49Z")

</div>

Hi folks,

I released NotNaughty version 0.6.2.

NotNaughty is a validation framework. It’s main purpose was to provide  
more customizable validations to Ruby-Sequel but it can be used for  
all things you might want to validate.

FEATURES:

- conditions  
with :if or :unless pointing to procs or methods

- stateful  
you can define the set of conditions for the current state of your  
instance

- easy to extend  
validations are encapsulated so you can just inherit from  
NotNaughty::Validation and get a validates\_xyz\_of with conditions for  
free

- easy to use  
there are various ways to setup a validation on an attribute but  
you can define them almost like with any other validation api

- exception handler  
wrap SQLError or any other exception in validation errors

INSTALL

$ gem install not-naughty  
or  
$ gem install sequel\_notnaughty

USE

require ‘rubygems’  
require ‘not\_naughty’

NotNaughty::Validation.load ‘format’ # load your validations

class Setup  
extend NotNaughty

```
 attr_accessor :serial_no
 validates(:serial_no) { format :with => SerialMatcher.new }

```

end

CHANGES since 0.5 (not-naughty)

- NotNaughty::Builder is now NotNaughty::ClassMethods
- NotNaughty::Builder::ValidationDelegator is now  
NotNaughty::ClassMethods::Builder
- NotNaughty::ClassMethods::Builder does not inherit from Delegation  
anymore, so { format :with =\> /rx/ } works
- NotNaughty::Validation loads validations from directories listed  
in load\_paths
- cleaned up some code parts
- added support for predefined format expressions [resolves:#19814]
- fixed Rakefile
- removed Ruby-Sequel adapter
- removed assistance gem dependency

CHANGES (sequel\_notnaughty)

- split from not-naughty gem
- added uniqueness validation with scope [resolves:#19650]
- works with Ruby-Sequel \>= 2

BUGS

- [rubyforge.org/projects/not-naughty](http://rubyforge.org/projects/not-naughty)

HACKING

- [GitHub - boof/not-naughty: Validation Framework for Ruby.](http://github.com/boof/not-naughty)
- [github.com/boof/sequel\_notnaughty](http://github.com/boof/sequel_notnaughty)

Cheers  
Florian
