= Mongo DB generators Rails 3 generators to generate Mongo DB models and database configs for Mongoid and MongoMapper. 1. Create new Rails 3 project 2. In Gemfile add gem 'mongo_db_model' 3. In console run $ gem bundle Using Mongo Mapper: a. To set application ORM to Mongo Mapper: # config/application.rb config.generators do |g| g.orm :mongo_mapper end b. Generate Mongo Mapper model $ script/generate mongo_mapper:model post name:string Using Mongoid: a. To set application ORM to Mongoid # config/application.rb config.generators do |g| g.orm :mongoid end b. Generate Mongoid model $ script/generate mongoid:model post name:string = Executables When the gem is installed the followin executables are also installed. You can use the executables globally on your system, in any Ruby or Rails project simply by running the executables are demonstrated below. == MongoMapper database config mongomap_db [database name] $ mongomap_db my_database == Mongoid database config mongoid_db [database name] $ mongoid_db my_database == Mongoid model mongoid_model [model name] [attributes] $ mongoid_model Post name:string expires:date == MongoMapper model mongomap_model [model name] [attributes] $ mongomap_model Post name:string expires:date = Note on Patches/Pull Requests * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. Bonus points for topic branches. = Copyright Copyright (c) 2010 Kristian Mandrup. See LICENSE for details.