rails 3.2 fixes
Merge pull request #1 from ncri/master

rails 3.2