In pure SQL it would be: select * from page where page_part_id in ( select page_part_id from page_parts where name = "body" and content is null )
Or you could do a join select * from page p, page_part p1 where p.page_part_id = p1.page_part_id and p1.name="body" p1.content is null I'm not well versed enough in Rails to know how to do this, ha! Isn't there a "sql" option in ActiveRecord where you can just push in db-sql and not worry about Rails doing the joins? _______________________________________________ Radiant mailing list Post: [email protected] Search: http://radiantcms.org/mailing-list/search/ List Site: http://lists.radiantcms.org/mailman/listinfo/radiant Radiant: http://radiantcms.org Extensions: http://ext.radiantcms.org
