提交 fc25feb3 编写于 作者: J Juanjo Bazán

Missing generated query for pluck method.

(and changed the use of true for a more database agnostic example).
上级 ddab3df8
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册