title: Problems using Struct.new() into a Rails 3.2.3 MongoID model method
body: <p>I've a mongoid model and method like the following :</p>
  
  <pre><code>class Category
    include Mongoid::Document
    field :name, :type =&gt; String
    ...
  
    def self.custom_find
      ...
      Str = Struct.new(:arg1, :arg2)
      array &lt;&lt; Str.new(one, two)
      ...
    end
  end
  </code></pre>
  
  <p>and I get the following error :</p>
  
  <pre><code>dynamic constant assignment (SyntaxError)
      Str = Struct.new(:arg1, :arg2)
  </code></pre>
  
  <p>I tried moving <code>Str = Struct.new(:arg1, :arg2)</code> into config/initializers/categories.rb but then I get :</p>
  
  <pre><code>BSON::InvalidDocument in TrendsController#index
  
  Cannot serialize an object of class Category into BSON.
  </code></pre>
  
  <p>by removing the custom_find offending method, everithing else works fine, then I guess is something related to <code>"Struct"</code>.</p>
  
  <p>Any idea ?</p>