Fix for #6

Fix for incompatibility with Rails 3.2.x.
Fix for STI model classes.