[Rails] Re: activerecord - finding parent info..

sergio ruiz
2006-07-05T18:25:03Z

> Assuming your models are wired up like so:
>
> class Podcast < ActiveRecord::Base
>    has_many :episodes
> end
>
> class Episode < ActiveRecord::Base
>    belongs_to :podcast
> end
>
> You''d be able to do this:
>
> e = Episode.find(1)
> e.podcast
>

yes, that is how they are wired.. i will try that..

thanks!


--
Posted via http://www.ruby-forum.com/.