Patch to make work for Rails4.