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

Allow ActiveRecord::Base#pluck to accept hash values #51565

Merged
merged 1 commit into from Apr 14, 2024

Conversation

fatkodima
Copy link
Member

Follow up to #45612 and #50000.

# Before
Post.joins(:comments).pluck("posts.id", "comments.id", "comments.body")

# After
Post.joins(:comments).pluck(posts: [:id], comments: [:id, :body])

The same applies to .pick, which is implemented using .pluck.

@kamipo kamipo merged commit 0feecd2 into rails:main Apr 14, 2024
7 of 8 checks passed
@fatkodima fatkodima deleted the pluck-hash-syntax branch April 14, 2024 14:05
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

2 participants