# Rails finders , how do you find based on children's attribut

**URL:** <https://www.ruby-forum.com/t/rails-finders-how-do-you-find-based-on-childrens-attribut/110387>\
**Category:** Rails\
**Created:** [July 25, 2007, 11:29pm UTC](https://www.ruby-forum.com/t/rails-finders-how-do-you-find-based-on-childrens-attribut/110387 "2007-07-25T23:29:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://www.ruby-forum.com/u/jay)\
**Post date:** [July 25, 2007, 11:29pm UTC](https://www.ruby-forum.com/t/rails-finders-how-do-you-find-based-on-childrens-attribut/110387/1 "2007-07-25T23:29:04Z")

</div>

So,

I have

class Building \< ActiveRecord::Base  
has\_many :programs  
end

class Program \< Activerecord::Base  
belongs\_to :building  
end

I want to find all Buildings that have at least one program.type  
== x

Is there any easy rails way to do this?

Thanks!

Jay
