Update for rails edge (4.2) fixes #580