Make rails 4 compatible