All my models in an app

4 views
Skip to first unread message

nahum

unread,
Aug 27, 2007, 10:48:15 PM8/27/07
to WellRailed
Is there a call I can make to get an array of all the models in my app
- the clasess that is not the instances. :o)


Cheers,
Nahum.

nahum

unread,
Aug 27, 2007, 10:50:29 PM8/27/07
to WellRailed
Let me qualify that, I want to iterate through all my ActiveRecord
based classes. So an array of them would be nice, rather than typing
them all out....

Shane Mingins

unread,
Aug 27, 2007, 11:00:32 PM8/27/07
to WellR...@googlegroups.com
what about something like:

ActiveRecord::Base.connection.tables.map {|t| t.classify}


--
Shane Mingins

nahum

unread,
Aug 27, 2007, 11:10:09 PM8/27/07
to WellRailed
Nice, that does it exactly

On Aug 28, 3:00 pm, "Shane Mingins" <shane.ming...@gmail.com> wrote:
> what about something like:
>
> ActiveRecord::Base.connection.tables.map {|t| t.classify}
>

Reply all
Reply to author
Forward
0 new messages