title: Rails - group_by
body: <p>My application has a few reports and I'm trying to make a helper method for group_by for all these collections. </p>
  
  <p>Example:</p>
  
  <pre><code>def group_collection(collection, options = {})
      column = options[:column]
      group_count = collection.group_by{ |item| item.column.strftime('%b %y')}
  end
  </code></pre>
  
  <p>This is how i plan to use it</p>
  
  <pre><code>@user_groups = group_collection(@users, :column =&gt; "created_at")
  </code></pre>
  
  <p>Unfortunately, this does not work. </p>
  
  <pre><code>undefined method `column' for... [CollectionObject]
  </code></pre>
  
  <p>Any clues on how to make the "column" variable an actual column type at runtime so it considers itself as activerecord column and not a instance method?</p>