title: How find users in database with same content in Ruby on Rails?
body: <p>In my database I have column <strong>:inviter</strong> and some users have same content in that column</p>
  
  <p><strong>I want find all them,with same content</strong></p>
  
  <p>In my user controller:</p>
  
  <pre><code>  def foll
      @user = current_user
      @ref = User.find_by_invite(@user.id.to_s)
      if !@ref || !@ref.pay_s || !@ref.pay_1 || !@ref.pay_2 || !@ref.pay_3
        @referals = false
      else
        @referals = User.find_by_invite(@user.id.to_s)
      end
    end
  </code></pre>
  
  <p>In my views</p>
  
  <pre><code>&lt;% if @referals != false %&gt;
    &lt;% @referals.each do |user| %&gt;
        &lt;h4&gt;
          &lt;%= link_to user.name, user %&gt; status : Good
        &lt;/h4&gt;
    &lt;% end %&gt;
    &lt;% else %&gt;
    &lt;h3&gt;You dont have any referrals&lt;/h3&gt;
    &lt;% end %&gt;
  </code></pre>
  
  <p>When I try I have this error </p>
  
  <pre><code>undefined method `each' for #&lt;User:0x007f13e41b0068&gt;
  </code></pre>