DescendantSet includes Enumerable so you just do DataMapper::Model.descendants.each do |model| model.repository ... end
On Wed, May 02, 2012 at 12:19:06PM -0400, Jason Brennan wrote: > Aha! This seems to work for me, thanks. > > I checked the docs for the DescendantSet class, and it appears all its > methods are private. Is there a proper way to iterate over all its elements? > > I see the -each method, but since that's private I'm wondering if this is the > best way to go (in case, for example, it changes in the future). > > Thanks so much for your help! > Jason. > > On 2012-05-02, at 10:24 AM, Rhett Sutphin wrote: > > > You can use `DataMapper::Model.descendants` to get all the registered model > > classes. > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/datamapper?hl=en. > -- Markus Schirp Phone: +49 201 / 360 379 14 Fax: +49 201 / 360 379 16 Web: www.seonic.net Email: [email protected] Twitter: twitter.com/_m_b_j_ OS-Code: github.com/mbj Seonic IT-Systems GbR Anton Shatalov & Markus Schirp Altendorferstrasse 44 D-45127 Essen -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
