Add support for rails 4.

Fixes #1