Hi all, suppose I have the following model: class FrotaEmpresa < ActiveRecord::Base belongs_to :servico, :foreign_key=>''sev_codigo'' belongs_to :tipo_veiculo, :foreign_key=>''tve_codigo'' end in my controller I''m building a query like this: select = "fro_codigo, f.for_cod, fro_num_ordem, fro_placa, fro_num_sentados, fro_num_pe, fro_data_vistoria, fro_chassi, fro_ano_chassi, fro_ano_fabricacao, fro_situacao, tb_fro_frota_onibus.created_at, for_num_transportadora, for_cnpj, for_razao_social, for_logradouro, for_bairro, for_cidade, for_uf, for_cep, sv.sev_codigo, sv.sev_descricao, mar_descricao, moc_descricao, tic_descricao, tve_descricao, mcc_descricao, tcc_descricao" joins =[" inner join TB_SEV_SERVICO_VEICULO SV on SV.SEV_CODIGO TB_FRO_FROTA_ONIBUS.SEV_CODIGO" + " inner join TB_TVE_TIPO_VEICULO TV on TB_FRO_FROTA_ONIBUS.TVE_CODIGO = TV.TVE_CODIGO" +] conditions = "fro_situacao<>0" FrotaEmpresa.find(:all, :select => select, :joins => joins, :conditions => conditions, :order=>"tb_fro_frota_onibus.for_cod, fro_num_ordem") Strangely,my find method executes a "select * from" in the "FrotaEmpresa" table for each "FrotaEmpresa" returned in the query which contains the joins. How can I solve this? Regards, Rafael Roque -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.