Permalink
Browse files

Missing generated query for pluck method.

(and changed the use of true for a more database agnostic example).
  • Loading branch information...
1 parent ddab3df commit fc25feb341e0ae0cd0c634ccc57446feab18565c @xuanxu xuanxu committed Mar 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/calculations.rb
@@ -174,7 +174,7 @@ def calculate(operation, column_name, options = {})
#
# Person.pluck(:id) # SELECT people.id FROM people
# Person.uniq.pluck(:role) # SELECT DISTINCT role FROM people
- # Person.where(:confirmed => true).limit(5).pluck(:id)
+ # Person.where(:age => 21).limit(5).pluck(:id) # SELECT people.id FROM people WHERE people.age = 21 LIMIT 5
#
def pluck(column_name)
key = column_name.to_s.split('.', 2).last

0 comments on commit fc25feb

Please sign in to comment.