Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can´t access the attributes of the original record object after casting via #attributes #183

Closed
martinschaflitzl1 opened this issue Dec 21, 2023 · 0 comments · Fixed by #184

Comments

@martinschaflitzl1
Copy link
Contributor

martinschaflitzl1 commented Dec 21, 2023

base_record = BaseRecord.create!(persisted_string: 'foo')
ActiveType::Util.cast(base_record, ExtendedRecord)

base_record.attributes # <- throws a ActiveType::MutationAfterCastError

IMHO should this be supported, as it should not be possible to change the attributes using #attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant