title: undefined method `is_current' for #<ActiveRecord::Relation:0x38622a8> in ruby on rails update data
body: <p>I'm trying to update some data in database but I'm getting this error:</p>
  
  <pre><code>undefined method `is_current' for #&lt;ActiveRecord::Relation:0x38622a8&gt;
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>@user = User.where("user_id = #{user_id} and is_current = 1") 
  
  if @user.nil?
    puts"xxxxxxxxxxxxxxxxxxxxxxxxxxx"
  else 
    @user.is_current = 0
    @user.to = Time.now
    @user.save
  end
  </code></pre>