From 2be6df693ab076fa077ac7e0f7df6802f3748ce1 Mon Sep 17 00:00:00 2001 From: clst Date: Mon, 12 Dec 2011 18:27:51 +0100 Subject: changed :finder_sql example to select * because with select p.* you can no longer use count(). Using count will result in an SQL error message. --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 3e24f3dee6..a7600a07d8 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1185,7 +1185,7 @@ module ActiveRecord # has_many :subscribers, :through => :subscriptions, :source => :user # has_many :subscribers, :class_name => "Person", :finder_sql => Proc.new { # %Q{ - # SELECT DISTINCT p.* + # SELECT DISTINCT * # FROM people p, post_subscriptions ps # WHERE ps.post_id = #{id} AND ps.person_id = p.id # ORDER BY p.first_name -- cgit v1.2.3