update for ruby 2 and rails 4