Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
ActiveRecord::Calculations#pluck accepts multiple columns #6500
Rails currently supports this:
I added two possibilities:
Because I made some stupid mistakes while updating my own fork of rails/rails this is a new fork and a follow up of the discussion located here: #5472
@carlos, you were right with your comment my mistakes. Just fixed and pushed it!
@jon In my previous pull request, several people liked it (see #5472). So IMO that's not the problem. But why do you want to support just one of the possibilities of Post.pluck([:a, :b]) and Post.pluck(:a, :b) and not both?
Ensure it works with mix of symbols and strings, and with a select clause possibly containing more than one column. Also remove support for pluck with an array of columns, in favor of passing the list of attributes: Model.pluck(:a, :b) See comments: rails#6500 (comment)