Rails 4 compatibility

@mguinada:
- Replaced deprecated ActiveRecord finders
- Updated gemspec

This change breaks compatibility with rails < 4.0, so I kept it on a separate branch.