title: Custom validation Rails for boolean attributes
body: <p>I need to add custom validation to my AR model: there is Order model with 'approved' attribute - this attribute cannot be approved twice. It's boolean attribute. I don't understand how can I check if this attribute has been approved already. </p>
  
  <pre><code>validate :cannot_be_approved_twice
  
    def cannot_be_approved_twice
      errors[:base] &lt;&lt; ERROR_MSG if ...
    end
  </code></pre>
  
  <p>How can I check it? Thanks!</p>