#88 ✓resolved
Bjørn Arild Mæland

[PATCH] Easy CHECK-constraints for Postgres

Reported by Bjørn Arild Mæland | December 10th, 2007 @ 04:01 PM

For those of us who likes to have guarantees for valid data, CHECK-constraints is a must. This patch makes it a snap to specify them directly in your properties. Support for multiple columns could be added later. Example usage:

class Person < DataMapper::Base

property :name, :string

property :age, :integer, :nullable => false, :check => "age > 18"

property :notes, :text, :lazy => true


Spec included. (I also removed some cruft in column.rb, by utilizing attr_reader and attr_writer.)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket