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

Custom types typecasting problem

    XMLWordPrintable

    Details

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

      Description

      I seem to run into a problem related to this with custom types (ruby 1.9.4, mongoid 3.0.9):

      In a document, I have a field :practice, type: Address

      When reading that value, I get the correct behaviour (typecasted) with:

      doc.practice #=> Address

      but I get the wrong behaviour (the serialized version of the object) with:

      doc.read_attribute("practice") #=> [...]
      doc.attributes #=> all attributes, practice: [...]
      doc["practice"] #=> [...]

        Attachments

          Activity

            People

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            caifara caifara
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: