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

🐛💥 Remove accidental Data#attributes method #371

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jan 3, 2025

#attributes isn't part of the core Data API, and it never should've been added as a public method to our polyfill.

For ruby 3.2+, this is a bugfix: Data#attributes wasn't defined and this PR fixes YAML encoding.

For ruby 3.1, this is technically a breaking change.

Since this only affects ruby 3.1 and this was only recently added (in v0.5.2), it's unlikely anyone has written code that uses this #attributes. If they have, they'll need to convert it to use #to_h instead.

`#attributes` isn't part of the core `Data` API, and it never should've
been added as a public method to our polyfill.

This is a breaking API change, _but only for users on ruby 3.1._

For users on ruby 3.2+, this is _not_ a breaking change.  For newer ruby
versions, `Data#attributes` wasn't defined and this fixes YAML encoding.

Since this only affects ruby 3.1 and this was only recently added (in
v0.5.2), it's unlikely anyone has written code that uses this method.
If they have, they'll need to convert it to `#to_h`.
@nevans nevans added bug Something isn't working breaking-change Breaking change to publicly documented API labels Jan 3, 2025
@nevans nevans merged commit 22d860a into master Jan 3, 2025
37 checks passed
@nevans nevans deleted the remove-data-attributes branch January 3, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Breaking change to publicly documented API bug Something isn't working
Development

Successfully merging this pull request may close these issues.

1 participant