pedz/activerecord_constraints — pull request #2 by cluesque (2013-02-20 15:38:57+00:00)
Title: Compatibility with rails 3.1

Some changes that got constraint exception handling in my app to work with rails 3.1

There were three issues I dealt with:
1. Constraint handlers not being loaded. I worked around this by doing a "require 'activerecord_constraint_handlers'" in the after_initialize of my application.rb - I do think the gem should be able to handle this, but got tired of trying to figure it out.
2. postgresql_connection not being called, and therefore not causing ConstraintHandlers::Postgresql to be loaded into the model classes. I changed to "include ActiveRecord::ConnectionAdapters::ConstraintHandlers::Postgresql" in the base include, and this seems to work, at least for my application.
3. default_scoping not defined on ActiveRecord::Base - an old internal accessor no longer used any more?

I'm still not happy with needing "require 'activerecord_constraint_handlers'" in the after_initialize of my application.rb - feedback on that appreciated.