from the api I got:
has_many :subscribers, :class_name => "Person", :finder_sql => 'SELECT DISTINCT people.* ' + 'FROM people p, post_subscriptions ps ' + 'WHERE ps.post_id = #{id} AND ps.person_id = p.id ' + 'ORDER BY p.first_name'
I would like to pass in the the id of the object that calls
subscribers.
for instance @email.subscribers could have the association:
has_many :subscribers, :class_name => “Person”, :finder_sql =>
'SELECT DISTINCT people.* ’ +
'FROM people p, post_subscriptions ps ’ +
‘WHERE ps.post_id = #{id} AND ps.person_id = p.id ’ +
’ AND ps.email_id = #{self.id OR @email.id ???}’ +
‘ORDER BY p.first_name’
I did try the above example but it did not work.
Any suggestions?
Roland