title: How to find index of array of records return from database in rails?
body: <p>I am getting array of records from sql query now I want to find whether current users record is present in that array of records and at which position. So I wrote following query but it is returning null.  </p>
  
  <pre><code>@top_score_cards = Score.group(:points).distinct.order("points DESC, updated_at DESC").where("points != ? And activity_id= ?",0,params[:@myActivity])#.limit(3)
  @current_users_rank=@top_score_cards.index(current_user)
  
  puts @current_users_rank 
  </code></pre>