{"issue":{"state":"open","created_at":"2011-12-06T01:23:07Z","updated_at":"2011-12-06T09:07:04Z","user":{"gravatar_id":"2274a7476f6d2ac7aedcdec0651d0542","id":14947,"url":"https://api.github.com/users/ernie","login":"ernie","avatar_url":"https://secure.gravatar.com/avatar/2274a7476f6d2ac7aedcdec0651d0542?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":3,"body":"This patch basically amounts to a merge of Valium into Rails core. Implements value_of/values_of functionality as exists in https://github.com/ernie/valium.\r\n\r\nSuperset of the recent pluck functionality, with the following enhancements:\r\n\r\n* Only runs the DB query if required. If the records have already been loaded, simply maps through them and reads the attributes\r\n* Supports multiple attributes:\r\n\r\n```ruby\r\nUser.where(:active => true).values_of(:name, :email).each do do |name, email|\r\n  puts \"#{name}'s e-mail address is #{email}\"\r\nend\r\n````\r\n* deserializes serialized attributes\r\n\r\nAdded a few new tests, corrected test names. All tests pass, and all Valium specs pass without loading the Valium gem when this code is active, so this should be backwards-compatible for those people who are already using Valium.\r\n\r\nThanks!","assignee":null,"id":2457388,"labels":[],"pull_request":{"patch_url":"https://github.com/rails/rails/pull/3871.patch","html_url":"https://github.com/rails/rails/pull/3871","diff_url":"https://github.com/rails/rails/pull/3871.diff"},"number":3871,"title":"Add value_of/values_of to AR::Base/AR::Relation","html_url":"https://github.com/rails/rails/issues/3871","closed_at":null,"url":"https://api.github.com/repos/rails/rails/issues/3871","milestone":null},"action":"created","comment":{"created_at":"2011-12-06T09:07:04Z","updated_at":"2011-12-06T09:07:04Z","user":{"gravatar_id":"5c11b2e624af2cb13797e47442067ea6","id":207112,"url":"https://api.github.com/users/gmile","login":"gmile","avatar_url":"https://secure.gravatar.com/avatar/5c11b2e624af2cb13797e47442067ea6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":":+1:","id":3029795,"url":"https://api.github.com/repos/rails/rails/issues/comments/3029795"}}