Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-192

Find by ObjectID directly if you use Mongoid.use_object_ids = true

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Mongoid has a great option, where we can choose between using or not ObjectID like key.

      But if we choose Mongoid.use_object_ids = true, when we made a find, we need allways cast our String to BSON::ObjectID.

      I made a patch to avoid that. With it, if you define Mongoid.use_object_ids = true, you can find directly by String. You can see all in my branch fix-objectids on my repo http://github.com/shingara/mongoid/commits/fix-objectids

      There are 3 commits to integrate I think,

            Assignee:
            Unassigned Unassigned
            Reporter:
            shingara Cyril Mougel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: