We use multiple databases in our project. The wiki recommends the following:
class LegacyBase < ActiveRecord::Base
self.abstract_class = true
establish_connection "legacy_#{RAILS_ENV}"
end
class LegacyOrder < LegacyBase
...
end
class LegacyLineItem < LegacyBase
...
end
With update 5753, this no longer works. We have the following:
class Record < ActiveRecord::Base
self.abstract_class = true
establish_connection "opus_#{RAILS_ENV}"
end
When we try to access the classes that extend this, we now get:
SQL (0.000000) PGError: ERROR: relation "records" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = 'records'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
ActiveRecord::StatementInvalid (PGError: ERROR: relation "records" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = 'records'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
For us, 5753 creates more problems than it solved!