Removing deprecated code to work with Rails 3.2