# ANN: Sequel 0.4.5 Released

**URL:** <https://rubytalk.org/t/ann-sequel-0-4-5-released/43275>\
**Category:** ruby-talk\
**Created:** [25 December 2007 07:37 UTC](https://rubytalk.org/t/ann-sequel-0-4-5-released/43275 "2007-12-25T07:37:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon\_Rosner](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@Sharon\_Rosner](https://rubytalk.org/u/Sharon_Rosner)\
**Post date:** [25 December 2007 07:37 UTC](https://rubytalk.org/t/ann-sequel-0-4-5-released/43275/1 "2007-12-25T07:37:23Z")

</div>

Sequel version 0.4.5 has just been released. Sequel is a lightweight  
database access and ORM library for Ruby. Sequel provides thread  
safety, connection pooling and a simple and expressive API for  
constructing database queries and table schemas.

This release includes new model validations and a few minor bug fixes  
and improvements. Here are the changes:

=== New model validations

Sequel now includes support for validations in models. The validations  
functionality is based on the Validatable gem (http://  
[validatable.rubyforge.org](http://validatable.rubyforge.org)), which needs to be installed if validations  
are to be used. Validations can be defined in two forms. First there  
is the validates method, which takes a block:

&nbsp;&nbsp;class User \< Sequel::Model(:users)  
&nbsp;&nbsp;&nbsp;&nbsp;validates do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format\_of :email, :with =\> /somewhackyregexp/  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;presence\_of :name  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;end

You can also invoke all the validate\_xxx methods supported by  
validatable directly:

&nbsp;&nbsp;class User \< Sequel::Model(:users)  
&nbsp;&nbsp;&nbsp;&nbsp;validates\_format\_of :email, :with =\> /somewhackyregexp/  
&nbsp;&nbsp;&nbsp;&nbsp;validates\_presence\_of :name  
&nbsp;&nbsp;end

To check if an instance is valid you can call the #valid? method:

&nbsp;&nbsp;user.valid?

To check if a model class has defined validations you can invoke  
has\_validations?:

&nbsp;&nbsp;User.has\_validations?

=== Other changes

\* Fixed update\_sql with array sub-item keys (#110).  
\* Added Model#update as alias to #set.  
\* Added Database#set\_column\_default method (thanks Jim Morris.)  
\* Added rdoc for new alter\_table functionality (#109).  
\* Refactored model specs.  
\* Removed warning on uninitialized @transform value (thanks Jim  
Morris).

=== More info

Sequel project page:  
&nbsp;&nbsp;\<[http://code.google.com/p/ruby-sequel](http://code.google.com/p/ruby-sequel)\>

Sequel documentation:  
&nbsp;&nbsp;\<[http://sequel.rubyforge.org](http://sequel.rubyforge.org)\>

Join the Sequel-talk group:  
&nbsp;&nbsp;\<[http://groups.google.com/group/sequel-talk](http://groups.google.com/group/sequel-talk)\>

Install the gem:  
&nbsp;&nbsp;sudo gem install sequel

Or check out the source and install manually:  
&nbsp;&nbsp;svn co [http://ruby-sequel.googlecode.com/svn/trunk](http://ruby-sequel.googlecode.com/svn/trunk) sequel  
&nbsp;&nbsp;cd sequel  
&nbsp;&nbsp;rake install
