def searchwithstatus
@agency=params[:agency][:agency_id]
@contract=params[:agency][:contracts_id]
@agencies=Agency.find(:all,:conditions=>{:deleted=>1,:contract_id=>@contract,:state_id=>@state})
end
when i am executing the code in line 3 it is saying as
__"Mysql::Error: Unknown column 'agencies.contract_id' in 'where clause': SELECT * FROM `agencies`
WHERE (`agencies`.`state_id` = '1' AND `agencies`.`contract_id` = '13' AND `agencies`.`deleted` = 1)__ "
**how can i access the contract_id which is in another table**