fix deprecation warnings in rails 4

@pwiebe