fix deprecation warning for rails 4

Needs Review