Changes for rails4 and ruby 2.1.0