Skip to content

Conversation

@h6ah4i
Copy link
Contributor

@h6ah4i h6ah4i commented Nov 28, 2022

Hi. I noticed that ActiveHash's #pluck method behaves differently from ActiveRecord one. This pull request fixes the issue.

Current behavior (ActiveHash v3.1.1)

Category.pluck(:id, :name, :language)
=> [
  [[1, "US"], "English"],
  [[2, "Canada"], "English"],
  [[3, "Mexico"], "Spanish"]
]

Expected behavior (same as ActiveRecord)

Category.pluck(:id, :name, :language)
=> [
  [1, "US", "English"],
  [2, "Canada", "English"],
  [3, "Mexico", "Spanish"]
]

@h6ah4i h6ah4i force-pushed the fix/pluck-more-than-two-attrs branch from d863fc0 to 0c9fda6 Compare November 28, 2022 07:37
@kbrock kbrock added the bug label Nov 28, 2022
Copy link
Collaborator

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

looks good. thanks for the tests

@kbrock kbrock merged commit cd24253 into active-hash:master Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants