fix errors and deprecation warnings
fix houndci warnings
fix houndci warnings
fix houndci warning
Merge pull request #1861 from YusiFan/rails4_new

Fix errors and deprecation warnings