from the api I got:
<pre>
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''
</pre>
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
--
Posted via http://www.ruby-forum.com/.