Custom types typecasting problem

XMLWordPrintableJSON

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

      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 (Inactive)
              Reporter:
              caifara
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: