Active record problem

Hey,

i’m having 2 tables:
TABLE A

id
name
b_id #id from TABLE B


TABLE B

id
name

the problem is i want all the objects form table b where there’s no
record for in table a.

so0ly wrote:

id
name

the problem is i want all the objects form table b where there’s no
record for in table a.

B.find( :all,
:select => ‘b.*’,
:joins => ‘left join a on b.id = a.b_id’,
:conditions => ‘a.b_id is null’ )


We develop, watch us RoR, in numbers too big to ignore.

Mark Reginald J. wrote:

so0ly wrote:

id
name

the problem is i want all the objects form table b where there’s no
record for in table a.

B.find( :all,
:select => ‘b.*’,
:joins => ‘left join a on b.id = a.b_id’,
:conditions => ‘a.b_id is null’ )


We develop, watch us RoR, in numbers too big to ignore.

thnx :slight_smile: