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

mongoid indifferent access for hash fields

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 6.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Durran Jordan

      we are using a gem like the following. It is a life saver. It would be great if mongoid 5 can support this natively.

      https://github.com/mindscratch/mongoid-indifferent-access

      A Mongoid Hash extension enabling "indifferent access" so you can access keys using Strings or Symbols.

      BSON stores document keys as strings, so Hash keys are strings when going into MongoDB and coming out. This extension allows a developer to not worry as to whether or not the keys are Strings or Symbols. Instead, by relying on ActiveSupport all Hashes can be accessed using whichever approach suites the developer.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: