I'm re-doing an app and migrating data from an old app. The some of the models names will be the same, though not all of them.
I'm writing a rake task to connect to the old database, read the records, do some stuff and write the result into a new database. Because some of the table names are the same the model names will be the same, so I want to name space my models like so
module OldData
class Account <ActiveRecord::Base
has_many :subcriptions
establish_connection $olddb
end
class Subscription <ActiveRecord::Base
belongs_to :account
establish_connection $olddb
end
end
where $olddb is a hash required to connect to the old database
I can open account records and read them ok, but the Account model doesn't have a subscriptions association. The latest Rails documentation suggest that this should work. but it doesn't.
Any advice?