Update model condition for Rails 4