title: How to use reject with a counter in Ruby or Ruby in Rails
body: <p>I am trying to use <code>reject</code> method in ruby but I need to stop after a certain count. For example</p>
  
  <pre><code>users = Users.all # this will be list of 1000 users
  
  count = 0
  user.reject! do |user|
   user.name == 'python'
  end
  </code></pre>
  
  <p>I want to stop the reject condition when count reaches 100, so something like </p>
  
  <pre><code>count = 0
  user.reject! do |user|
    user.name == 'python'
    count += 1
    if count == 100
      break
    end 
  end
  </code></pre>
  
  <p>I agree the syntax above is wrong, and need some help from you. I am fairly new to ruby so I will appreciate any help. Thanks</p>