ros-apartment 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/.rubocop-linter.yml +22 -0
- data/.pryrc +5 -3
- data/.rubocop.yml +17 -0
- data/.rubocop_todo.yml +29 -0
- data/.story_branch.yml +4 -0
- data/.travis.yml +12 -11
- data/Appraisals +18 -18
- data/Gemfile +4 -1
- data/README.md +33 -5
- data/Rakefile +2 -0
- data/apartment.gemspec +6 -6
- data/gemfiles/rails_4_2.gemfile +12 -10
- data/gemfiles/rails_5_0.gemfile +11 -9
- data/gemfiles/rails_5_1.gemfile +11 -9
- data/gemfiles/rails_5_2.gemfile +10 -8
- data/gemfiles/rails_6_0.gemfile +11 -9
- data/gemfiles/rails_master.gemfile +11 -9
- data/lib/apartment/adapters/abstract_adapter.rb +34 -34
- data/lib/apartment/adapters/abstract_jdbc_adapter.rb +4 -3
- data/lib/apartment/adapters/jdbc_mysql_adapter.rb +3 -3
- data/lib/apartment/adapters/jdbc_postgresql_adapter.rb +13 -11
- data/lib/apartment/adapters/mysql2_adapter.rb +10 -9
- data/lib/apartment/adapters/postgis_adapter.rb +3 -2
- data/lib/apartment/adapters/postgresql_adapter.rb +28 -25
- data/lib/apartment/adapters/sqlite3_adapter.rb +16 -8
- data/lib/apartment/console.rb +28 -3
- data/lib/apartment/custom_console.rb +26 -0
- data/lib/apartment/deprecation.rb +2 -1
- data/lib/apartment/elevators/domain.rb +4 -3
- data/lib/apartment/elevators/first_subdomain.rb +3 -2
- data/lib/apartment/elevators/generic.rb +4 -3
- data/lib/apartment/elevators/host.rb +6 -1
- data/lib/apartment/elevators/host_hash.rb +6 -2
- data/lib/apartment/elevators/subdomain.rb +9 -5
- data/lib/apartment/migrator.rb +4 -3
- data/lib/apartment/railtie.rb +13 -5
- data/lib/apartment/reloader.rb +2 -1
- data/lib/apartment/tasks/enhancements.rb +4 -6
- data/lib/apartment/tenant.rb +3 -4
- data/lib/apartment/version.rb +3 -1
- data/lib/apartment.rb +15 -9
- data/lib/generators/apartment/install/install_generator.rb +4 -3
- data/lib/generators/apartment/install/templates/apartment.rb +3 -2
- data/lib/tasks/apartment.rake +19 -18
- data/spec/adapters/jdbc_mysql_adapter_spec.rb +5 -4
- data/spec/adapters/jdbc_postgresql_adapter_spec.rb +10 -12
- data/spec/adapters/mysql2_adapter_spec.rb +15 -13
- data/spec/adapters/postgresql_adapter_spec.rb +22 -20
- data/spec/adapters/sqlite3_adapter_spec.rb +41 -23
- data/spec/apartment_spec.rb +4 -2
- data/spec/dummy/app/controllers/application_controller.rb +4 -3
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/application_record.rb +6 -0
- data/spec/dummy/app/models/company.rb +4 -2
- data/spec/dummy/app/models/user.rb +4 -2
- data/spec/dummy/config/application.rb +11 -9
- data/spec/dummy/config/boot.rb +4 -2
- data/spec/dummy/config/environment.rb +3 -1
- data/spec/dummy/config/environments/development.rb +2 -1
- data/spec/dummy/config/environments/production.rb +3 -1
- data/spec/dummy/config/environments/test.rb +3 -1
- data/spec/dummy/config/initializers/apartment.rb +4 -2
- data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -0
- data/spec/dummy/config/initializers/inflections.rb +1 -0
- data/spec/dummy/config/initializers/mime_types.rb +1 -0
- data/spec/dummy/config/initializers/secret_token.rb +2 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -1
- data/spec/dummy/config/routes.rb +3 -1
- data/spec/dummy/config.ru +3 -1
- data/spec/dummy/db/seeds/import.rb +3 -1
- data/spec/dummy/script/rails +4 -2
- data/spec/dummy_engine/config/initializers/apartment.rb +4 -3
- data/spec/dummy_engine/lib/dummy_engine/engine.rb +2 -0
- data/spec/dummy_engine/lib/dummy_engine/version.rb +3 -1
- data/spec/dummy_engine/lib/dummy_engine.rb +3 -1
- data/spec/dummy_engine/test/dummy/config/application.rb +4 -2
- data/spec/dummy_engine/test/dummy/config/boot.rb +4 -2
- data/spec/dummy_engine/test/dummy/config/environment.rb +3 -1
- data/spec/dummy_engine/test/dummy/config/environments/development.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/environments/production.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/environments/test.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/initializers/assets.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb +1 -0
- data/spec/dummy_engine/test/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/spec/dummy_engine/test/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/initializers/inflections.rb +1 -0
- data/spec/dummy_engine/test/dummy/config/initializers/mime_types.rb +1 -0
- data/spec/dummy_engine/test/dummy/config/initializers/session_store.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/spec/dummy_engine/test/dummy/config/routes.rb +2 -0
- data/spec/dummy_engine/test/dummy/config.ru +3 -1
- data/spec/examples/connection_adapter_examples.rb +15 -13
- data/spec/examples/generic_adapter_custom_configuration_example.rb +21 -23
- data/spec/examples/generic_adapter_examples.rb +40 -39
- data/spec/examples/schema_adapter_examples.rb +93 -88
- data/spec/integration/apartment_rake_integration_spec.rb +24 -24
- data/spec/integration/query_caching_spec.rb +10 -8
- data/spec/integration/use_within_an_engine_spec.rb +5 -5
- data/spec/schemas/v1.rb +2 -3
- data/spec/schemas/v2.rb +22 -24
- data/spec/schemas/v3.rb +26 -28
- data/spec/spec_helper.rb +8 -6
- data/spec/support/apartment_helpers.rb +9 -5
- data/spec/support/capybara_sessions.rb +5 -5
- data/spec/support/config.rb +5 -2
- data/spec/support/contexts.rb +10 -8
- data/spec/support/requirements.rb +19 -6
- data/spec/support/setup.rb +5 -5
- data/spec/tasks/apartment_rake_spec.rb +30 -35
- data/spec/tenant_spec.rb +48 -44
- data/spec/unit/config_spec.rb +26 -27
- data/spec/unit/elevators/domain_spec.rb +9 -8
- data/spec/unit/elevators/first_subdomain_spec.rb +14 -12
- data/spec/unit/elevators/generic_spec.rb +16 -15
- data/spec/unit/elevators/host_hash_spec.rb +9 -8
- data/spec/unit/elevators/host_spec.rb +26 -26
- data/spec/unit/elevators/subdomain_spec.rb +24 -23
- data/spec/unit/migrator_spec.rb +18 -17
- data/spec/unit/reloader_spec.rb +8 -8
- metadata +40 -22
@@ -1,39 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'apartment/adapters/postgresql_adapter'
|
3
5
|
|
4
6
|
describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
|
5
7
|
unless defined?(JRUBY_VERSION)
|
6
8
|
|
7
|
-
subject{ Apartment::Tenant.postgresql_adapter config }
|
8
|
-
|
9
|
-
context "using schemas with schema.rb" do
|
9
|
+
subject { Apartment::Tenant.postgresql_adapter config }
|
10
10
|
|
11
|
-
|
11
|
+
context 'using schemas with schema.rb' do
|
12
|
+
before { Apartment.use_schemas = true }
|
12
13
|
|
13
14
|
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
14
15
|
def tenant_names
|
15
|
-
ActiveRecord::Base.connection.execute(
|
16
|
+
ActiveRecord::Base.connection.execute('SELECT nspname FROM pg_namespace;').collect { |row| row['nspname'] }
|
16
17
|
end
|
17
18
|
|
18
19
|
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.gsub('"', '') } }
|
19
20
|
|
20
|
-
it_should_behave_like
|
21
|
-
it_should_behave_like
|
21
|
+
it_should_behave_like 'a generic apartment adapter'
|
22
|
+
it_should_behave_like 'a schema based apartment adapter'
|
22
23
|
end
|
23
24
|
|
24
|
-
context
|
25
|
-
|
26
|
-
|
25
|
+
context 'using schemas with SQL dump' do
|
26
|
+
before do
|
27
|
+
Apartment.use_schemas = true
|
28
|
+
Apartment.use_sql = true
|
29
|
+
end
|
27
30
|
|
28
31
|
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
29
32
|
def tenant_names
|
30
|
-
ActiveRecord::Base.connection.execute(
|
33
|
+
ActiveRecord::Base.connection.execute('SELECT nspname FROM pg_namespace;').collect { |row| row['nspname'] }
|
31
34
|
end
|
32
35
|
|
33
36
|
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.gsub('"', '') } }
|
34
37
|
|
35
|
-
it_should_behave_like
|
36
|
-
it_should_behave_like
|
38
|
+
it_should_behave_like 'a generic apartment adapter'
|
39
|
+
it_should_behave_like 'a schema based apartment adapter'
|
37
40
|
|
38
41
|
it 'allows for dashes in the schema name' do
|
39
42
|
expect { Apartment::Tenant.create('has-dashes') }.to_not raise_error
|
@@ -42,20 +45,19 @@ describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
|
|
42
45
|
after { Apartment::Tenant.drop('has-dashes') if Apartment.connection.schema_exists? 'has-dashes' }
|
43
46
|
end
|
44
47
|
|
45
|
-
context
|
46
|
-
|
47
|
-
before{ Apartment.use_schemas = false }
|
48
|
+
context 'using connections' do
|
49
|
+
before { Apartment.use_schemas = false }
|
48
50
|
|
49
51
|
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
50
52
|
def tenant_names
|
51
|
-
connection.execute(
|
53
|
+
connection.execute('select datname from pg_database;').collect { |row| row['datname'] }
|
52
54
|
end
|
53
55
|
|
54
56
|
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }
|
55
57
|
|
56
|
-
it_should_behave_like
|
57
|
-
it_should_behave_like
|
58
|
-
it_should_behave_like
|
58
|
+
it_should_behave_like 'a generic apartment adapter'
|
59
|
+
it_should_behave_like 'a generic apartment adapter able to handle custom configuration'
|
60
|
+
it_should_behave_like 'a connection based apartment adapter'
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'apartment/adapters/sqlite3_adapter'
|
3
5
|
|
4
6
|
describe Apartment::Adapters::Sqlite3Adapter, database: :sqlite do
|
5
7
|
unless defined?(JRUBY_VERSION)
|
6
8
|
|
7
|
-
subject{ Apartment::Tenant.sqlite3_adapter config }
|
9
|
+
subject { Apartment::Tenant.sqlite3_adapter config }
|
8
10
|
|
9
|
-
context
|
11
|
+
context 'using connections' do
|
10
12
|
def tenant_names
|
11
|
-
db_dir = File.expand_path(
|
13
|
+
db_dir = File.expand_path('../dummy/db', __dir__)
|
12
14
|
Dir.glob("#{db_dir}/*.sqlite3").map { |file| File.basename(file, '.sqlite3') }
|
13
15
|
end
|
14
16
|
|
@@ -16,18 +18,18 @@ describe Apartment::Adapters::Sqlite3Adapter, database: :sqlite do
|
|
16
18
|
subject.switch { File.basename(Apartment::Test.config['connections']['sqlite']['database'], '.sqlite3') }
|
17
19
|
end
|
18
20
|
|
19
|
-
it_should_behave_like
|
20
|
-
it_should_behave_like
|
21
|
+
it_should_behave_like 'a generic apartment adapter'
|
22
|
+
it_should_behave_like 'a connection based apartment adapter'
|
21
23
|
|
22
24
|
after(:all) do
|
23
25
|
File.delete(Apartment::Test.config['connections']['sqlite']['database'])
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
27
|
-
context
|
29
|
+
context 'with prepend and append' do
|
28
30
|
let(:default_dir) { File.expand_path(File.dirname(config[:database])) }
|
29
|
-
describe
|
30
|
-
let
|
31
|
+
describe '#prepend' do
|
32
|
+
let(:db_name) { 'db_with_prefix' }
|
31
33
|
before do
|
32
34
|
Apartment.configure do |config|
|
33
35
|
config.prepend_environment = true
|
@@ -35,32 +37,44 @@ describe Apartment::Adapters::Sqlite3Adapter, database: :sqlite do
|
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
38
|
-
after
|
40
|
+
after do
|
41
|
+
begin
|
42
|
+
subject.drop db_name
|
43
|
+
rescue StandardError => _e
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
end
|
39
47
|
|
40
|
-
it
|
48
|
+
it 'should create a new database' do
|
41
49
|
subject.create db_name
|
42
50
|
|
43
|
-
expect(File.
|
51
|
+
expect(File.exist?("#{default_dir}/#{Rails.env}_#{db_name}.sqlite3")).to eq true
|
44
52
|
end
|
45
53
|
end
|
46
54
|
|
47
|
-
describe
|
48
|
-
let
|
55
|
+
describe '#neither' do
|
56
|
+
let(:db_name) { 'db_without_prefix_suffix' }
|
49
57
|
before do
|
50
58
|
Apartment.configure { |config| config.prepend_environment = config.append_environment = false }
|
51
59
|
end
|
52
60
|
|
53
|
-
after
|
61
|
+
after do
|
62
|
+
begin
|
63
|
+
subject.drop db_name
|
64
|
+
rescue StandardError => _e
|
65
|
+
nil
|
66
|
+
end
|
67
|
+
end
|
54
68
|
|
55
|
-
it
|
69
|
+
it 'should create a new database' do
|
56
70
|
subject.create db_name
|
57
71
|
|
58
|
-
expect(File.
|
72
|
+
expect(File.exist?("#{default_dir}/#{db_name}.sqlite3")).to eq true
|
59
73
|
end
|
60
74
|
end
|
61
75
|
|
62
|
-
describe
|
63
|
-
let
|
76
|
+
describe '#append' do
|
77
|
+
let(:db_name) { 'db_with_suffix' }
|
64
78
|
before do
|
65
79
|
Apartment.configure do |config|
|
66
80
|
config.prepend_environment = false
|
@@ -68,16 +82,20 @@ describe Apartment::Adapters::Sqlite3Adapter, database: :sqlite do
|
|
68
82
|
end
|
69
83
|
end
|
70
84
|
|
71
|
-
after
|
85
|
+
after do
|
86
|
+
begin
|
87
|
+
subject.drop db_name
|
88
|
+
rescue StandardError => _e
|
89
|
+
nil
|
90
|
+
end
|
91
|
+
end
|
72
92
|
|
73
|
-
it
|
93
|
+
it 'should create a new database' do
|
74
94
|
subject.create db_name
|
75
95
|
|
76
|
-
expect(File.
|
96
|
+
expect(File.exist?("#{default_dir}/#{db_name}_#{Rails.env}.sqlite3")).to eq true
|
77
97
|
end
|
78
98
|
end
|
79
|
-
|
80
99
|
end
|
81
|
-
|
82
100
|
end
|
83
101
|
end
|
data/spec/apartment_spec.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Apartment do
|
4
|
-
it
|
6
|
+
it 'should be valid' do
|
5
7
|
expect(Apartment).to be_a(Module)
|
6
8
|
end
|
7
9
|
|
8
|
-
it
|
10
|
+
it 'should be a valid app' do
|
9
11
|
expect(::Rails.application).to be_a(Dummy::Application)
|
10
12
|
end
|
11
13
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
3
|
+
require File.expand_path('boot', __dir__)
|
4
|
+
|
5
|
+
require 'active_model/railtie'
|
6
|
+
require 'active_record/railtie'
|
7
|
+
require 'action_controller/railtie'
|
8
|
+
require 'action_view/railtie'
|
9
|
+
require 'action_mailer/railtie'
|
8
10
|
|
9
11
|
Bundler.require
|
10
|
-
require
|
12
|
+
require 'apartment'
|
11
13
|
|
12
14
|
module Dummy
|
13
15
|
class Application < Rails::Application
|
@@ -20,7 +22,7 @@ module Dummy
|
|
20
22
|
config.middleware.use Apartment::Elevators::Subdomain
|
21
23
|
|
22
24
|
# Custom directories with classes and modules you want to be autoloadable.
|
23
|
-
config.autoload_paths += %W
|
25
|
+
config.autoload_paths += %W[#{config.root}/lib]
|
24
26
|
|
25
27
|
# Only load the plugins named here, in the order given (default is alphabetical).
|
26
28
|
# :all can be used as a placeholder for all plugins not explicitly named.
|
@@ -41,7 +43,7 @@ module Dummy
|
|
41
43
|
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
42
44
|
|
43
45
|
# Configure the default encoding used in templates for Ruby 1.9.
|
44
|
-
config.encoding =
|
46
|
+
config.encoding = 'utf-8'
|
45
47
|
|
46
48
|
# Configure sensitive parameters which will be filtered from the log file.
|
47
49
|
config.filter_parameters += [:password]
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
|
3
|
-
gemfile = File.expand_path('
|
5
|
+
gemfile = File.expand_path('../../../Gemfile', __dir__)
|
4
6
|
|
5
7
|
if File.exist?(gemfile)
|
6
8
|
ENV['BUNDLE_GEMFILE'] = gemfile
|
@@ -8,4 +10,4 @@ if File.exist?(gemfile)
|
|
8
10
|
Bundler.setup
|
9
11
|
end
|
10
12
|
|
11
|
-
|
13
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Dummy::Application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb
|
3
5
|
|
@@ -25,4 +27,3 @@ Dummy::Application.configure do
|
|
25
27
|
# Only use best-standards-support built into browsers
|
26
28
|
config.action_dispatch.best_standards_support = :builtin
|
27
29
|
end
|
28
|
-
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Dummy::Application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb
|
3
5
|
|
@@ -12,7 +14,7 @@ Dummy::Application.configure do
|
|
12
14
|
config.action_controller.perform_caching = true
|
13
15
|
|
14
16
|
# Specifies the header that your server uses for sending files
|
15
|
-
config.action_dispatch.x_sendfile_header =
|
17
|
+
config.action_dispatch.x_sendfile_header = 'X-Sendfile'
|
16
18
|
|
17
19
|
# For nginx:
|
18
20
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Dummy::Application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb
|
3
5
|
|
@@ -17,7 +19,7 @@ Dummy::Application.configure do
|
|
17
19
|
config.action_dispatch.show_exceptions = false
|
18
20
|
|
19
21
|
# Disable request forgery protection in test environment
|
20
|
-
config.action_controller.allow_forgery_protection
|
22
|
+
config.action_controller.allow_forgery_protection = false
|
21
23
|
|
22
24
|
# Tell Action Mailer not to deliver emails to the real world.
|
23
25
|
# The :test delivery method accumulates sent emails in the
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Be sure to restart your server when you modify this file.
|
2
4
|
|
3
|
-
Dummy::Application.config.session_store :cookie_store, :
|
5
|
+
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
6
|
|
5
7
|
# Use the database for sessions instead of the cookie-based default,
|
6
8
|
# which shouldn't be used to store highly confidential information
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/config.ru
CHANGED
data/spec/dummy/script/rails
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
5
|
|
4
|
-
APP_PATH = File.expand_path('
|
5
|
-
require File.expand_path('
|
6
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
7
|
+
require File.expand_path('../config/boot', __dir__)
|
6
8
|
require 'rails/commands'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Require whichever elevator you're using below here...
|
2
4
|
#
|
3
5
|
# require 'apartment/elevators/generic'
|
@@ -8,7 +10,6 @@ require 'apartment/elevators/subdomain'
|
|
8
10
|
# Apartment Configuration
|
9
11
|
#
|
10
12
|
Apartment.configure do |config|
|
11
|
-
|
12
13
|
# These models will not be multi-tenanted,
|
13
14
|
# but remain in the global (public) namespace
|
14
15
|
#
|
@@ -17,13 +18,13 @@ Apartment.configure do |config|
|
|
17
18
|
#
|
18
19
|
# config.excluded_models = %w{Tenant}
|
19
20
|
#
|
20
|
-
config.excluded_models = %w
|
21
|
+
config.excluded_models = %w[]
|
21
22
|
|
22
23
|
# use postgres schemas?
|
23
24
|
config.use_schemas = true
|
24
25
|
|
25
26
|
# use raw SQL dumps for creating postgres schemas? (only appies with use_schemas set to true)
|
26
|
-
#config.use_sql = true
|
27
|
+
# config.use_sql = true
|
27
28
|
|
28
29
|
# configure persistent schemas (E.g. hstore )
|
29
30
|
# config.persistent_schemas = %w{ hstore }
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('boot', __dir__)
|
2
4
|
|
3
5
|
require 'rails/all'
|
4
6
|
|
5
7
|
Bundler.require(*Rails.groups)
|
6
|
-
require
|
8
|
+
require 'dummy_engine'
|
7
9
|
|
8
10
|
module Dummy
|
9
11
|
class Application < Rails::Application
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Set up gems listed in the Gemfile.
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
3
5
|
|
4
6
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
|
-
$LOAD_PATH.unshift File.expand_path('
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|