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

Create a blacklist to disallow mutator methods to be delegated to Array #13314

Merged
merged 1 commit into from Dec 17, 2013

Conversation

laurocaetano
Copy link
Contributor

@laurocaetano laurocaetano commented Dec 14, 2013

This change was necessary because the whitelist wouldn't work.
It would be painful for users trying to update their applications.

Related with: #12129

true
else
false
end
Copy link
Member

@jeremy jeremy Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def array_delegable?(method)
  Array.method_defined?(method) && BLACKLISTED_ARRAY_METHODS.exclude?(method)
end

Copy link
Contributor Author

@laurocaetano laurocaetano Dec 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 😄

@jeremy
Copy link
Member

jeremy commented Dec 16, 2013

Please rebase ❤️

@laurocaetano
Copy link
Contributor Author

laurocaetano commented Dec 16, 2013

rebased 💚

…ray`.

This change was necessary because the whitelist wouldn't work.
It would be painful for users trying to update their applications.

This blacklist intent to prevent odd bugs and confusion in code that call mutator
methods directely on the `Relation`.
jeremy added a commit that referenced this pull request Dec 17, 2013
Create a blacklist to disallow mutator methods to be delegated to Array

Conflicts:
	guides/source/upgrading_ruby_on_rails.md
@jeremy jeremy merged commit d4ee09c into rails:master Dec 17, 2013
@laurocaetano
Copy link
Contributor Author

laurocaetano commented Dec 17, 2013

💚 ❤️ 💙 💛

oliverguenther added a commit to oliverguenther/openproject that referenced this pull request Aug 10, 2015
rails/rails#13314 removed mutator methods
(e.g., `Array#sort!`) from relations.

This commit enforces returned work packages to be ordered by ID instead.
oliverguenther added a commit to oliverguenther/openproject that referenced this pull request Aug 11, 2015
rails/rails#13314 removed mutator methods
(e.g., `Array#sort!`) from relations.

This commit enforces either an ordering on the query itself where
applicable, or uses a non-mutator sort.
myabc pushed a commit to myabc/openproject that referenced this pull request Aug 19, 2015
rails/rails#13314 removed mutator methods
(e.g., `Array#sort!`) from relations.

This commit enforces either an ordering on the query itself where
applicable, or uses a non-mutator sort.
myabc added a commit to eurucamp/eurucamp-activities that referenced this pull request Mar 11, 2017
rails/rails#13314 removed mutator methods
(e.g., `Array#sort!`) from relations.
myabc added a commit to eurucamp/eurucamp-activities that referenced this pull request Apr 10, 2018
rails/rails#13314 removed mutator methods
(e.g., `Array#sort!`) from relations.
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 this pull request may close these issues.

None yet

5 participants