Minimize quantity of sql queries to detecting foreign keys.
Now this query are executed for every model. It is very annoyed in development environment, since model files are reloaded on every web request and we got an additional query for every model.
After this patch the query will be executed only for models with ':foreign' option in the 'index'.
Also version of ActiveRecord was limited to <=3.2, since the gem incompatible with ActiveRecord 4.0