I'd like to validate a birthdate attribute to be over 18 years old
<p>I'm currently programming on ruby on rails with the devise gem. Added a birthdate to my user and I'm trying to validate the user being over 18 years old. I tried this, but it's not working.</p>

<pre><code>class User &lt; ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
    def is_older?()
        (DateTime.now - :birth_date).to_i &gt;= 6570

    end
  validates :birth_date, :presence =&gt;{:if =&gt; {:is_older? =&gt;{:message =&gt; 'You should be over 18 years old.'}}}



  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

end
</code></pre>

<p>I don't know if  :presence should be there but I added it so it wouldn't show any errors. Basically I'm trying to use an if statement as a validater if that is possible, which would be checking if the difference between the birth date the user tried to register and the date of today is higher than 18 years. 
Thanks a lot!</p>