mongoid/mongoid — pull request #2693 by subhashb (2013-01-11 09:53:20+00:00)
Title: Adding "collections" option to the generator

Added a collections option to the generator.

**Context:**
I am writing a gem that is converting ActiveRecord models automatically to Mongoid documents, through a generator. While I am able to alter the name of the model being generated (to identify it as a Mongoid Document, different from the ActiveRecord model), I still want the collections to be with the same name as the original AR model.

Please pull if you think the requirement makes sense in the base repository too.

**Sample usage in Generator:**
````ruby
def run_mongoid_generator
generate "mongoid:model", "#{model_name.camelize}Doc name:string --collection=#{model_name.pluralize}"
end
````

Let me know if there is any other simpler way of accomplishing this requirement.