Forum: Ruby on Rails Rails finders , how do you find based on children's attribut

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fdb969158f6b65ebfd0d1a3442975d52?d=identicon&s=25 Jay (Guest)
on 2007-07-25 23:29
(Received via mailing list)
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
This topic is locked and can not be replied to.