Rails3.2 v8

Rebased #360.