title: Ruby on Rails, Select Users with age range from Active Record
body: <p>User.rb</p>
  
  <pre><code># Attributes
  # (..)
  # birthdate (string)
  #  format "mm/yyyy"
  
  def age
    dob = self.birthdate.to_date
    now = Time.now.utc.to_date
    now.year - dob.year - ((now.month &gt; dob.month || (now.month == dob.month &amp;&amp; now.day &gt;= dob.day)) ? 0 : 1)
  end
  </code></pre>
  
  <p>In the console:</p>
  
  <pre><code>irb(main):002:0&gt; current_user.age
  =&gt; 7
  </code></pre>
  
  <p>I'd be able to do the following:</p>
  
  <pre><code>age_range = "25-65"
  User.where(:age =&gt; between age_range)
  </code></pre>
  
  <p>I'm stuck at the point how to get the value from age (class method) into the where call</p>