Updates for model to work with Rails 4