Upgraded for Rails 4