Support rails 4

All specs are passed.