Fix for rails 4

Works with rails 4.0.0