Hacky Rails 4 support, while maintaining support for Rails 3 and below.
Merge pull request #15 from Wingar/master

Rails 4 support