I’ve got a legacy database that I’m trying to model in ActiveRecord.
The database consists of many pairs of tables (e.g. Foo_Sources and
Foo_Procedures, Bar_Sources and Bar_Procedures). There will be
multiple pairs of tables, serving different purposes but sharing a
common schema (Foo_Sources and Bar_Sources will be identical except
for the table name).
I’d like to model these in ActiveRecord, but I’m not sure how to
approach the problem. The tables I access will be determined at
runtime, and the database itself is dynamic (Baz_Sources will appear
in the future, and I don’t want to have to change the code to support
Anyone have any ideas? I’m a relative newcomer to Ruby/Rails, but I
get the impression something like this could be handled since Ruby is
such a dynamic language. Maybe some kind of ActiveRecord class
Any suggestions would be appreciated! Thanks in advance.