Open derekprior opened 9 months ago
In the meanwhile, what workaround could I use to run Scenic on my secondary database?
@leoplct I use Scenic in my primary database, but not in my cache database (SQLite). I was able to get rails db tasks to work by creating an initializer with this:
# Don't use Scenic in db tasks for SQLite
module CustomSchemaDumper
def dumpable_views_in_database
if ActiveRecord::Base.connection.adapter_name == "SQLite"
[]
else
super
end
end
end
# Don't use Scenic in db tasks for SQLite
module Scenic
module SchemaDumper
prepend CustomSchemaDumper
end
end
For some time now, Rails has offered multiple database support. Scenic, however, operated with the assumption that there is one database, hanging its functionality off the singleton,
Scenic.database
. We should make the changes necessary to support multiple databases, which may have the added benefit of easily offering view path configurability as has been asked for by a number of folks.I'm currently messing with multiple databases in a sample app and will use this issue to enumerate the changes I think we need to make.
--database
option