-
Greg Navis authored
composed_of values should be automatically frozen by Active Record. This worked correctly when assigning a new value object via the writer, but objects instantiated based on database columns were NOT frozen. The fix consists of calling #dup and then #freeze on the cached value object when it's added to the aggregation cache in #reader_method. Additionally, values assigned via the accessor are duplicated and then frozen to avoid caller confusion.
Greg Navis authoredcomposed_of values should be automatically frozen by Active Record. This worked correctly when assigning a new value object via the writer, but objects instantiated based on database columns were NOT frozen. The fix consists of calling #dup and then #freeze on the cached value object when it's added to the aggregation cache in #reader_method. Additionally, values assigned via the accessor are duplicated and then frozen to avoid caller confusion.
Loading