fix for rails 4 (https://github.com/rails/rails/commit/24c4195bab27ed9d76d0e126044e7f932de9e30e might be necessary for this to work properly)