Conversions to Rails 4, ruby 2.1.0