Database table name in array?


#1

Is it possible to do something like this?

tables = Array[ “Xxx”, “Yyy”, “Zzz”]

for table in tables
results = table.find(:all, :conditions => ["…
end


#2

I would try it and see. It will either work or not.

2009/1/30 James B. removed_email_address@domain.invalid


#3

James B. wrote:

Is it possible to do something like this?

tables = Array[ “Xxx”, “Yyy”, “Zzz”]

for table in tables
@records = table.camelcase.constantize.find(:all, blah blah blah)
end