Rails 4 vs Rails 3 fix