From a6b15bd2dc35f07bfb073ffc0b0375c9318665c5 Mon Sep 17 00:00:00 2001 From: clst Date: Mon, 12 Dec 2011 15:46:42 +0100 Subject: fixed example for :finder_sql people.* will not work when the alias is named p --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 98efdb90c8..3e24f3dee6 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 people.* + # SELECT DISTINCT p.* # 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