Add an example overriding field accessors with read/write_attribute

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Docs
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add an example (and a test if we don't have one) that transforms values using write_attribute and read_attribute, taking effect before serialization and after deserialization respectively. E.g. to retrieve field values in upper case:

      class Band
        def foo
          read_attribute(:foo).upcase
        end
      end
      

            Assignee:
            Unassigned
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: