From e3e4fa1f6504ba27200c25558462dd2ba6c1fcd3 Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Thu, 8 Nov 2012 19:14:35 +0530 Subject: make syntax of select.map(&:field) same as pluck The shortcut ampersand syntax of `select.map(&:field)` is same thing as `.plunk(:field)`. document that --- guides/source/active_record_querying.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides') diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index da56d55deb..d5c23b416c 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1364,6 +1364,8 @@ Client.pluck(:id, :name) ```ruby Client.select(:id).map { |c| c.id } # or +Client.select(:id).map(&:id) +# or Client.select(:id).map { |c| [c.id, c.name] } ``` -- cgit v1.2.3