Hook on AR::Base.define_attribute_methods in order to prevent eager load of models

The `table_exists?` call was triggering database connection, which break assets precompilation with Rails 4 on Heroku.

This new way define the callback right after attributes definition, so no need to check for table existence etc.

All tests pass with AR 4.0.0, I didn't tested with 3.x but I think it should be ok.

Regards