I'm trying to select workorders using find_by_sql. The where
portion of the sql needs to test against some ruby code:
I tried this:
<% Workorder.find_by_sql("SELECT * FROM workorders w JOIN empgroups e USING (workgroup_id) WHERE e.employee_id = ?, <%= current_user.employee.id %>").each do |workorder| %>
But, it doesn't seem to pre-process the <%= current_user.employee.id %>
Thanks for the help!