title: Validate the number of has_many items in Ruby on Rails
body: <p>Users can add tags to a snippet:</p>
  
  <pre><code>class Snippet &lt; ActiveRecord::Base
  
    # Relationships
    has_many :taggings
    has_many :tags, :through =&gt; :taggings
    belongs_to :closing_reason
  
  end
  </code></pre>
  
  <p>I want to validate the number of tags: at least 1, at most 6. How am I about to do this? Thanks.</p>