Ruby: Model ActiveModel#serializable_hash#12253
Conversation
b007839 to
38f2f5e
Compare
This method returns a hash of the attributes of the receiver.
38f2f5e to
bc0b481
Compare
|
Apologies if you got pinged by this - I briefly rebased against an old version of |
| | | ||
| input = "Argument[self].Field[" + field + "]" and | ||
| output = "ReturnValue.Element[\"" + name + "\"]" and | ||
| preservesValue = true |
There was a problem hiding this comment.
@hvitved do you have any recommendations on how to express this in a way that doesn't generate tons of new dataflow steps?
There was a problem hiding this comment.
I don't think there is an easy fix. At least, we will only be generating one read-field-store-element chain per field in the DB inside the synthesized callable, so maybe it is not too bad in practice. Alternatively, we could have the much less precise version, as you suggest:
input = "Argument[self].Field[any]" and
output = "ReturnValue.Element[?]"
There was a problem hiding this comment.
OK - I'll run a few more DCA runs and we can make a decision on whether the performance hit is too much. I think Field[any] is not a syntax we support (yet), but I will double check.
There was a problem hiding this comment.
I think
Field[any]is not a syntax we support (yet)
Yeah, we don't support it yet, but should be easy to add.
This doesn't yet work - we need to model flow from ActiveRecord-like
fields to elements in the return hash.