作为一个例子,我想运行像这样的查询:
people = Person.select("GROUP_CONCAT(`first` SEPARATOR ', ') as names") \
.where(last: "smith").group(:age).order(:age)
# which basically gives me something like
# SELECT GROUP_CONCAT(`first` SEPARATOR ', ') as names ...
#####################
# but when I add pluck
people.pluck(:names)
# it does
# SELECT names ...
# and gives me an Unknown column error
如何让Rails/ActiveRecord处理选择查询结果上的pluck而不是覆盖它?
.
”反斜杠了。 - mu is too short