README.md in bson-objectid-to-uuid-0.1.2 vs README.md in bson-objectid-to-uuid-0.1.3

- old
+ new

@@ -1,8 +1,8 @@ # BSON::ObjectID::UUIDConvertable -This gem allows for you to use `BSON::ObjectId`'s and `UUIDv1`'s interchangeably with the mongo-ruby driver and/or mongoid. +This gem allows for you to use `BSON::ObjectId`'s and `UUIDv4`'s interchangeably with the mongo-ruby driver and/or mongoid. ## Installation Add this line to your application's Gemfile: @@ -18,35 +18,35 @@ $ gem install bson-objectid-to-uuid ## Usage -Convert a `BSON::ObjectId` to `UUIDv1`: +Convert a `BSON::ObjectId` to `UUIDv4`: ```ruby -oid = BSON::ObjectId.new # => BSON::ObjectId('5a785ae00d6cab0695bb7694') -oid.to_uuid # => "c9edf094-0a77-11e8-8076-bb0d6cab0695" +oid = BSON::ObjectId.new # => BSON::ObjectId('5a74c31b0d6cabe30aa88fad') +oid.to_uuid # => "0bdaea5a-74c3-41b0-ad6c-abe30aa88fad" ``` -Convert `UUIDv1` to `BSON::ObjectId`: +Convert `UUIDv4` to `BSON::ObjectId`: ```ruby -BSON::ObjectId.from_uuid("c9edf094-0a77-11e8-8076-bb0d6cab0695") # => BSON::ObjectId('5a785ae00d6cab0695bb7694') +BSON::ObjectId.from_uuid("0bdaea5a-74c3-41b0-ad6c-abe30aa88fad") # => BSON::ObjectId('5a74c31b0d6cabe30aa88fad') ``` ## Usage with Mongoid Getting the `UUIDv1` for a `Mongoid::Document`: ```ruby user = User.first # => #<User ... > -user._id.to_uuid # => "c9edf094-0a77-11e8-8076-bb0d6cab0695" +user._id.to_uuid # => "0bdaea5a-74c3-41b0-ad6c-abe30aa88fad" ``` Finding a `Mongoid::Document` using `UUIDv1`: ```ruby -user = User.find("c9edf094-0a77-11e8-8076-bb0d6cab0695") # => # => #<User ... > +user = User.find("0bdaea5a-74c3-41b0-ad6c-abe30aa88fad") # => # => #<User ... > ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.