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

Ensure attribute decorations are always inherited #39468

Conversation

jonathanhefner
Copy link
Member

Prior to this commit, attribute decorations were not inherited by a subclass if they were added to the parent class after the subclass had added its own attribute decorations. This was due to the way attribute decorations were stored in an append-only class_attribute. This commit changes the way attribute decorations are stored to ensure they are always inherited.


Splitting this off from #38871.

Prior to this commit, attribute decorations were not inherited by a
subclass if they were added to the parent class after the subclass had
added its own attribute decorations.  This was due to the way attribute
decorations were stored in an append-only `class_attribute`.  This
commit changes the way attribute decorations are stored to ensure they
are always inherited.
kamipo added a commit to kamipo/rails that referenced this pull request May 29, 2020
This is a common `class_attribute` implementation issue (e.g. rails#39467,
rails#39468, rails#38871).

For now, we should take care of the change propagation by themselves if
we want to ensure the propagation after the `class_attribute` are
accessed in subclasses.

Fixes rails#20678.
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Jun 14, 2020
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Jun 14, 2020
@rails-bot
Copy link

rails-bot bot commented Aug 27, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Aug 27, 2020
@jonathanhefner
Copy link
Member Author

Closing in favor of #39487.

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

Successfully merging this pull request may close these issues.

None yet

1 participant