title: add custom validation method in Ruby on Rails
body: <p>I need create a method the custom validation called findUpperCaseLetter or similar</p>
  
  <p>I have a attribute called password that belongs to the model called User </p>
  
  <p>My method is somewhat similar to the following. The password attribute must have at least a uppercase letter  </p>
  
  <pre><code>  def findUpperCaseLetter(username)
       username.each_char do |character| 
            return true if  character=~/[[:upper:]]/  
       end
  
     return false
  
    end
  </code></pre>
  
  <p>I want add this validation to the User model</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    attr_accessible :user_name,:email, :password
    validates_presence_of :user_name,:email, :password
    validates_uniqueness_of :user_name,:email
    ????
  end  
  </code></pre>
  
  <p>I have already the following regular expreession</p>
  
  <pre><code> validates_format_of :password, :with =&gt; /^[a-z0-9_-]{6,30}$/i, 
     message: "The password format is invalid"
  </code></pre>
  
  <p>How I modify it for add the following</p>
  
  <p>The password must have at least one uppercase letter</p>