Use code from 3.2.12 (not rails-4)