When I search in the default filter box, i get a mysql error:
Mysql::Error: Unknown column 'builds.build_id' in 'on clause': SELECT
count(DISTINCT `smokes`.id) AS count_all FROM `smokes` LEFT OUTER
JOIN `builds` ON (`smokes`.`id` = `builds`.`build_id`) LEFT OUTER
JOIN `products` ON (`products`.`id` = `builds`.`product_id`) LEFT
OUTER JOIN `builds` builds_smokes ON `builds_smokes`.id =
`smokes`.build_id WHERE (
smokes.id LIKE '%b%' OR
products.name LIKE '%b
%' OR
builds.name LIKE '%b%' OR smokes.notes LIKE '%b%' OR
smokes.result LIKE '%b%')
The problem is in the JOIN statements, it has the id fields on the
wrong side of the equation, instead of
smokes.id = builds.build_id it
should be smokes.build_id =
build.id. Any ideas on what could be
causing this? I'm rather certain my models' relationships are setup
correctly. Any insight would be appreciated.