Skip to content

phstc/mongomapper

 
 

Repository files navigation

This fork replaces BSON::ObjectId to auto incremented id in MongoMapper documents

This fork is based on github.com/phstc/mongomapper_id2

It was submitted as pull request github.com/jnunemaker/mongomapper/pull/200

# app/models/movie.rb
class Movie
  include MongoMapper::Document

  key :title, String
  # Here is the fork
  auto_increment!
end

movie = Movie.create(:title => 'The Simpsons Movie')
movie.id # 1

movie2 = Movie.create(:title => 'Pirates of Silicon Valley')
movie2.id # 2

A Ruby Object Mapper for Mongo.

$ gem install mongo_mapper
  • 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 in another branch so I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

$ gem install bundler (if you don't have it)
$ bundle install
$ bundle exec rake

Hit up the google group: groups.google.com/group/mongomapper

Hop on IRC: chat.freenode.net/#mongomapper

See LICENSE for details.

About

A Ruby Object Mapper for Mongo

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Ruby 100.0%