Skip to content
This repository
Browse code

fixed example for :finder_sql

people.* will not work when the alias is named p
  • Loading branch information...
commit a6b15bd2dc35f07bfb073ffc0b0375c9318665c5 1 parent b15e2be
clst clst authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  activerecord/lib/active_record/associations.rb
2  activerecord/lib/active_record/associations.rb
@@ -1185,7 +1185,7 @@ module ClassMethods
1185 1185 # has_many :subscribers, :through => :subscriptions, :source => :user
1186 1186 # has_many :subscribers, :class_name => "Person", :finder_sql => Proc.new {
1187 1187 # %Q{
1188   - # SELECT DISTINCT people.*
  1188 + # SELECT DISTINCT p.*
1189 1189 # FROM people p, post_subscriptions ps
1190 1190 # WHERE ps.post_id = #{id} AND ps.person_id = p.id
1191 1191 # ORDER BY p.first_name

0 comments on commit a6b15bd

Please sign in to comment.
Something went wrong with that request. Please try again.