I have two tables, a Projects table and a Clients table.
It’s basically a HABTM relationship, but I have additional project/
client-specific information in the join table. I’m trying to use the
new has_many :through method to join these. It works fine when
displaying records, but when I try to search, I’m having this problem:
When I used a HABTM model to search the project list for project and
client names, this worked fine:
@projects = Project.find(:all, :include => [:client], :conditions =>
[“client.name like ? or project.name like ?”, @query, @query])
However, doing this using the has_many :through technique doesn’t
seem to work, as it tries to joint “clients.project_id” to
“projects.id,” which won’t work because they’re not directly linked.
Is this a known issue, or is this by design?