Categories: None [Edit]

mongoid-bigbang

https://rubygems.org/gems/mongoid-bigbang
https://github.com/dnlserrano/mongoid-bigbang
When you have a project in which you are not using Mongoid::Timestamps and you want to mock an object's creation time, you have to do some cumbersome operations in order to get those first 4 bytes of the ObjectId to represent the seconds since the Unix epoch that you want for that object. Particularly, if you want to have two objects with the same creation time, it would not suffice to generate the IDs via the BSON::ObjectId.from_time method, since it would yield the same ID for both objects, and you probably do not want them to be seen as the same object. This gem solves this little annoying issue by generating a unique ID for the given timestamp by using the other 8 bytes in ObjectId to generate the needed additional entropy.

Total

Ranking: 117,471 of 196,150
Downloads: 6,393

Daily

Ranking: 35,210 of 196,123
Downloads: 2

Depended by

RankDownloadsName

Depends on

RankDownloadsName
13,669,460,804bundler
81,395,065,511rake
291,011,016,091rspec
72627,057,867pry
190284,718,852pry-byebug
3,0645,696,889moped

Owners

#GravatarHandle
1icondnlserrano