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

Custom types typecasting problem

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

      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"] #=> [...]

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

              Created:
              Updated:
              Resolved: