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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      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,

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: