core.rb fixed for Rails 4