How can I find(:all) on a parent model only for objects where a has_one child is nil?
Models
How can I find(:all) on a parent model only for objects where a has_one child is nil?
Models
Thanks Shai. I’ve been dipping into with_scope the last couple of days and it’s really interesting… especially when it comes to nesting. I’m not quite sure how I can utilize it in my situation though where I’m doing a left join on two models with a has_one relationship. Every example of with_scope I’ve seen as been acting within a single model. I’ll keep playing with it. In the meantime, find_by_sql is getting the job done.