File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,13 @@ setup_database() {
6565 local label=" ${adapter: + ($adapter )} "
6666 local env_cmd=" ${adapter: +env DATABASE_ADAPTER=$adapter } "
6767
68+ # When setting up sqlite in SAAS mode, we need to disable SAAS so that
69+ # database.yml will use database.sqlite.yml instead of the fizzy-saas config.
70+ # We also unset BUNDLE_GEMFILE so the standard Gemfile is used (without fizzy-saas).
71+ if [ -n " $SAAS " ] && [ " $adapter " = " sqlite" ]; then
72+ env_cmd=" env DATABASE_ADAPTER=$adapter SAAS=false BUNDLE_GEMFILE="
73+ fi
74+
6875 if [ " $reset " = " true" ]; then
6976 step " Resetting the database$label " $env_cmd rails db:reset
7077 else
Original file line number Diff line number Diff line change 11<%
2- require_relative "../lib/fizzy"
3-
42 config_path = if Fizzy.saas?
53 gem_path = Gem::Specification.find_by_name("fizzy-saas").gem_dir
64 File.join(gem_path, "config", "database.yml")
75 else
8- File.join(__dir__ , "database.#{Fizzy.db_adapter}.yml")
6+ File.join("config" , "database.#{Fizzy.db_adapter}.yml")
97 end
108% >
119<%= ERB.new(File.read(config_path)).result % >
You can’t perform that action at this time.
0 commit comments