title: Rails validate uniqueness only if conditional
body: <p>I have a Question class:</p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
    attr_accessible :user_id, :created_on
  
    validates_uniqueness_of :created_on, :scope =&gt; :user_id
  end
  </code></pre>
  
  <p>A given user can only create a single question per day, so I want to force uniqueness in the database via a unique index and the Question class via validates_uniqueness_of.  </p>
  
  <p>The trouble I'm running into is that I only want that constraint for non-admin users.  So admins can create as many questions per day as they want.  Any ideas for how to achieve that elegantly?</p>