Newer PG gems pass message as "PG::Error" ... roll with it
This seems to work with rails 3.1

1: don't know what default_scoping was about, but taking it out seems to help

2: seems that we can't count on postgresql_connection being called to cause ConstraintHandlers::Postgresql to be included.  good news: including at module load time seems ok
Cope with classes that have default scope

(also, more idiomatic activerecord 3)
Merge pull request #2 from cluesque/master

Compatibility with rails 3.1