Displaying 1 result from an estimated 1 matches for "axemanship".
2006 May 20
3
In a find, can''t you use both :include and :limit ?
...n, so I need to limit my
query to the number of results I want to display per page.
Here''s the type of thing I want to do:
Employee table <-> Skills_Employees table <-> Skills table
Let''s say I want to find all the employees who have skill with ID = 3
(''axemanship'').
The actual SQL might be:
SELECT * FROM employee, employees_skills es
WHERE
es.employee_id = employee.id
AND
es.skill_id = 3
In Rails, I figured out that the right way to do that *may* be:
employees = Employee.find(
:all,
:include => :skills,
:conditions => ["skill_id...