Take 2: fixing for Rails 4