Rails 4 compatibility
Merge pull request #423 from haines/rails_4

Rails 4 compatibility