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

Deprecate passing conditions to AR::Relation destroy_all and delete_all methods #21505

Conversation

morgoth
Copy link
Member

@morgoth morgoth commented Sep 5, 2015

As requested in #21491 (comment) by @matthewd and @sgrif

@rails-bot
Copy link

r? @matthewd

(@rails-bot has picked a reviewer for you, use r? to override)

# Person.where(age: 0..18).destroy_all
def destroy_all(conditions = nil)
if conditions
ActiveSupport::Deprecation.warn(<<-MESSAGE.squish)
Passing conditions to destroy_all is deprecated and will be removed in Rails 5.1.
To achieve the same use where(#{conditions}).destroy_all
Copy link
Member

Choose a reason for hiding this comment

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

Let's just use conditions instead of #{conditions}. Interpolation will introduce quoting issues, and could mess up the formatting of the message.

Copy link
Member Author

Choose a reason for hiding this comment

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

@matthewd done

@morgoth morgoth force-pushed the deprecate-passing-conditions-to-destroy_all-and-delete_all branch from a649daa to c82c5f8 Compare September 6, 2015 14:14
matthewd added a commit that referenced this pull request Sep 6, 2015
…o-destroy_all-and-delete_all

Deprecate passing conditions to AR::Relation destroy_all and delete_all methods
@matthewd matthewd merged commit e07b006 into rails:master Sep 6, 2015
@matthewd
Copy link
Member

matthewd commented Sep 6, 2015

Perfect, thanks!

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

3 participants