activerecord-typedstore icon indicating copy to clipboard operation
activerecord-typedstore copied to clipboard

Persist default values of aliased attributes

Open jonathanhefner opened this issue 3 years ago • 3 comments

1f150f6bc3194f803b15c400513f07aacf53939b made it so that default values are always persisted. This commit adds support for aliased attributes to that change.

jonathanhefner avatar Nov 03 '22 20:11 jonathanhefner

I considered this but wasn't expecting anyone to use aliased attributes in this case.

Is this something you are doing?

byroot avatar Nov 03 '22 21:11 byroot

Is this something you are doing?

No, I just wanted to make sure all the cases were covered. :smile: I wasn't sure how much aliased attributes were used at Shopify. But if they are explicitly not supported, I think it's fine.

jonathanhefner avatar Nov 03 '22 21:11 jonathanhefner

But if they are explicitly not supported, I think it's fine.

Yeah, I don't really see a use case for it to be honest. That said I initially took that decision in #94 because it was in much more of a hot path, it probably wouldn't matter here. We could also cache (or precompute) that array on the class.

byroot avatar Nov 03 '22 21:11 byroot