将查询转换为RoR ORM

时间:2015-03-06 17:05:54

标签: sql ruby-on-rails orm

我怎样才能使用ORM Ror。

SELECT T.* FROM tables T, businesses B 
       WHERE ( (T.business_id = B.id) AND (B.name LIKE 'Canary Code S.L.') 
       AND NOT EXISTS(  SELECT R.* 
                        FROM reserves R, reserve_intervals RI 
                        WHERE (R.reserve_date = '2014-05-12' AND RI.name LIKE 'TARDE')) );

0 个答案:

没有答案