Forum: Ruby on Rails Way to iterate over each associtaion

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
385174ee0ad01f8e48e93319ef40abb7?d=identicon&s=25 David Clements (Guest)
on 2006-03-23 23:25
(Received via mailing list)
Is there a way with ActiveRecord to get ahold of a collection containing
each association?  I want to write a rake task that will dump a model
all its related models to yaml.

9d1f5d2d9de70bd9a934f557dc95a406?d=identicon&s=25 Daniel ----- (liquid)
on 2006-03-23 23:37
(Received via mailing list)
I'm sorry David,

I can't answer but I would like to know as well..
6dab365a82517fb694650a57ee88e4a4?d=identicon&s=25 joey__ (Guest)
on 2006-03-24 00:00
Daniel ----- wrote:
> I'm sorry David,
> I can't answer but I would like to know as well..

[Model.instance_methods -
if m.class.superclass == ActiveRecord::Base||if
m.respond_to?(:first);m.first.class.superclass ==

Nasty. I don't know if there is a real way to do it.

This topic is locked and can not be replied to.