fixed example for :finder_sql

people.* will not work when the alias is named p
This commit is contained in:
clst
2011-12-12 15:46:42 +01:00
parent b15e2be6b0
commit a6b15bd2dc

View File

@@ -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