title: Understanding the `include` statement behavior for "subsequent" mixin modules
body: <p>I am trying to understand the <code>include</code> statement behavior when used in multiple Mixins. That is, I have these statements:</p>
  
  <pre><code>class Article &lt; ActiveRecord::Base
    include DoubleIncludedModule
    include AModule
  
    # ...
  end
  
  module AModule
    include DoubleIncludedModule
  
    # ...
  end
  
  module DoubleIncludedModule
    # ...
  end
  </code></pre>
  
  <p>How many times will be the <code>DoubleIncludedModule</code> included in the <code>Article</code> class? That is, since the "subsequent" inclusion of the <code>DoubleIncludedModule</code> (first in the <code>Article</code> class and then in <code>AModule</code> included by the <code>Article</code> class itself), will be the "double inclusion" issue automatically handled by Ruby or will the <code>DoubleIncludedModule</code> (wrongly) included two times?</p>
  
  <p>Of course, I would like to include the <code>DoubleIncludedModule</code> module <em>only one time</em>. How can I make that (maybe by using some Ruby on Rails methods) the proper way?</p>