Updated model files for Rails 4