Rails 4 bugfix