Fix deprecation warnings related to upgrade to rails4