Stop casting attributes on record initialization, do it lazy in stead.
thhermansen opened this issue · comments
After this commit (bcc02d6), orm records are keeping a copy of the hash which it loaded it's attributes from. This hash will be the source of data for embeds_many proxy, but can also be used to read and cast attributes lazy from. Right now we are casting fields on initialize (
), quite possibly doing more work than we need to do, since its unlikely that all attributes are accessed in a request.So I think we don't need to do this, and instead do casting only in reader method, caching the casted result.
Looks rather old. Closing it :-)