Fix with Rails 4.0.9+ and 4.1.5+