Skip to content

Commit

Permalink
make syntax of select.map(&:field) same as pluck
Browse files Browse the repository at this point in the history
The shortcut ampersand syntax of `select.map(&:field)` is same thing as `.plunk(:field)`. document that
  • Loading branch information
gaurish committed Nov 8, 2012
1 parent 8659212 commit e3e4fa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions guides/source/active_record_querying.md
Expand Up @@ -1364,6 +1364,8 @@ Client.pluck(:id, :name)
```ruby ```ruby
Client.select(:id).map { |c| c.id } Client.select(:id).map { |c| c.id }
# or # or
Client.select(:id).map(&:id)
# or
Client.select(:id).map { |c| [c.id, c.name] } Client.select(:id).map { |c| [c.id, c.name] }
``` ```


Expand Down

0 comments on commit e3e4fa1

Please sign in to comment.