Rails 4.1.1 example application to reproduce and demonstrate this issue: https://github.com/rails/rails/issues/15124