ros-apartment 2.3.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.pryrc +5 -3
- data/.rubocop.yml +22 -0
- data/.rubocop_todo.yml +29 -0
- data/.story_branch.yml +5 -0
- data/.travis.yml +20 -36
- data/Appraisals +16 -29
- data/Gemfile +5 -2
- data/Guardfile +3 -1
- data/HISTORY.md +57 -0
- data/README.md +64 -21
- data/Rakefile +36 -22
- data/TODO.md +0 -1
- data/apartment.gemspec +17 -10
- data/gemfiles/rails_4_2.gemfile +12 -10
- data/gemfiles/rails_5_0.gemfile +2 -1
- data/gemfiles/rails_5_1.gemfile +2 -1
- data/gemfiles/rails_5_2.gemfile +2 -1
- data/gemfiles/rails_6_0.gemfile +6 -5
- data/gemfiles/rails_master.gemfile +2 -1
- data/lib/apartment.rb +38 -14
- data/lib/apartment/active_record/connection_handling.rb +17 -0
- data/lib/apartment/active_record/internal_metadata.rb +11 -0
- data/lib/apartment/active_record/log_subscriber.rb +41 -0
- data/lib/apartment/active_record/schema_migration.rb +13 -0
- data/lib/apartment/adapters/abstract_adapter.rb +49 -45
- 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 +20 -13
- data/lib/apartment/adapters/mysql2_adapter.rb +12 -9
- data/lib/apartment/adapters/postgis_adapter.rb +3 -2
- data/lib/apartment/adapters/postgresql_adapter.rb +59 -27
- data/lib/apartment/adapters/sqlite3_adapter.rb +18 -8
- data/lib/apartment/console.rb +35 -3
- data/lib/apartment/custom_console.rb +42 -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/model.rb +27 -0
- data/lib/apartment/railtie.rb +27 -15
- data/lib/apartment/reloader.rb +2 -1
- data/lib/apartment/tasks/enhancements.rb +4 -6
- data/lib/apartment/tasks/task_helper.rb +35 -0
- data/lib/apartment/tenant.rb +19 -9
- data/lib/apartment/version.rb +3 -1
- data/lib/generators/apartment/install/install_generator.rb +4 -3
- data/lib/generators/apartment/install/templates/apartment.rb +8 -2
- data/lib/tasks/apartment.rake +22 -44
- metadata +51 -230
- data/spec/adapters/jdbc_mysql_adapter_spec.rb +0 -19
- data/spec/adapters/jdbc_postgresql_adapter_spec.rb +0 -41
- data/spec/adapters/mysql2_adapter_spec.rb +0 -59
- data/spec/adapters/postgresql_adapter_spec.rb +0 -61
- data/spec/adapters/sqlite3_adapter_spec.rb +0 -83
- data/spec/apartment_spec.rb +0 -11
- data/spec/config/database.yml.sample +0 -49
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -6
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/models/company.rb +0 -3
- data/spec/dummy/app/models/user.rb +0 -3
- data/spec/dummy/app/views/application/index.html.erb +0 -1
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -49
- data/spec/dummy/config/boot.rb +0 -11
- data/spec/dummy/config/database.yml.sample +0 -44
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -28
- data/spec/dummy/config/environments/production.rb +0 -51
- data/spec/dummy/config/environments/test.rb +0 -34
- data/spec/dummy/config/initializers/apartment.rb +0 -4
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -3
- data/spec/dummy/db/migrate/20110613152810_create_dummy_models.rb +0 -39
- data/spec/dummy/db/migrate/20111202022214_create_table_books.rb +0 -14
- data/spec/dummy/db/migrate/20180415260934_create_public_tokens.rb +0 -13
- data/spec/dummy/db/schema.rb +0 -55
- data/spec/dummy/db/seeds.rb +0 -5
- data/spec/dummy/db/seeds/import.rb +0 -5
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy_engine/.gitignore +0 -8
- data/spec/dummy_engine/Gemfile +0 -15
- data/spec/dummy_engine/Rakefile +0 -34
- data/spec/dummy_engine/bin/rails +0 -12
- data/spec/dummy_engine/config/initializers/apartment.rb +0 -51
- data/spec/dummy_engine/dummy_engine.gemspec +0 -24
- data/spec/dummy_engine/lib/dummy_engine.rb +0 -4
- data/spec/dummy_engine/lib/dummy_engine/engine.rb +0 -4
- data/spec/dummy_engine/lib/dummy_engine/version.rb +0 -3
- data/spec/dummy_engine/test/dummy/Rakefile +0 -6
- data/spec/dummy_engine/test/dummy/config.ru +0 -4
- data/spec/dummy_engine/test/dummy/config/application.rb +0 -22
- data/spec/dummy_engine/test/dummy/config/boot.rb +0 -5
- data/spec/dummy_engine/test/dummy/config/database.yml +0 -25
- data/spec/dummy_engine/test/dummy/config/environment.rb +0 -5
- data/spec/dummy_engine/test/dummy/config/environments/development.rb +0 -37
- data/spec/dummy_engine/test/dummy/config/environments/production.rb +0 -78
- data/spec/dummy_engine/test/dummy/config/environments/test.rb +0 -39
- data/spec/dummy_engine/test/dummy/config/initializers/assets.rb +0 -8
- data/spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_engine/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy_engine/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_engine/test/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy_engine/test/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy_engine/test/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy_engine/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_engine/test/dummy/config/locales/en.yml +0 -23
- data/spec/dummy_engine/test/dummy/config/routes.rb +0 -56
- data/spec/dummy_engine/test/dummy/config/secrets.yml +0 -22
- data/spec/examples/connection_adapter_examples.rb +0 -42
- data/spec/examples/generic_adapter_custom_configuration_example.rb +0 -95
- data/spec/examples/generic_adapter_examples.rb +0 -163
- data/spec/examples/schema_adapter_examples.rb +0 -234
- data/spec/integration/apartment_rake_integration_spec.rb +0 -107
- data/spec/integration/query_caching_spec.rb +0 -81
- data/spec/integration/use_within_an_engine_spec.rb +0 -28
- data/spec/schemas/v1.rb +0 -16
- data/spec/schemas/v2.rb +0 -43
- data/spec/schemas/v3.rb +0 -49
- data/spec/spec_helper.rb +0 -61
- data/spec/support/apartment_helpers.rb +0 -43
- data/spec/support/capybara_sessions.rb +0 -15
- data/spec/support/config.rb +0 -10
- data/spec/support/contexts.rb +0 -52
- data/spec/support/requirements.rb +0 -35
- data/spec/support/setup.rb +0 -46
- data/spec/tasks/apartment_rake_spec.rb +0 -129
- data/spec/tenant_spec.rb +0 -190
- data/spec/unit/config_spec.rb +0 -112
- data/spec/unit/elevators/domain_spec.rb +0 -32
- data/spec/unit/elevators/first_subdomain_spec.rb +0 -24
- data/spec/unit/elevators/generic_spec.rb +0 -54
- data/spec/unit/elevators/host_hash_spec.rb +0 -32
- data/spec/unit/elevators/host_spec.rb +0 -89
- data/spec/unit/elevators/subdomain_spec.rb +0 -76
- data/spec/unit/migrator_spec.rb +0 -77
- data/spec/unit/reloader_spec.rb +0 -24
@@ -1,41 +0,0 @@
|
|
1
|
-
if defined?(JRUBY_VERSION)
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'apartment/adapters/jdbc_postgresql_adapter'
|
5
|
-
|
6
|
-
describe Apartment::Adapters::JDBCPostgresqlAdapter, database: :postgresql do
|
7
|
-
|
8
|
-
subject { Apartment::Tenant.jdbc_postgresql_adapter config.symbolize_keys }
|
9
|
-
|
10
|
-
context "using schemas" do
|
11
|
-
|
12
|
-
before { Apartment.use_schemas = true }
|
13
|
-
|
14
|
-
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
15
|
-
def tenant_names
|
16
|
-
ActiveRecord::Base.connection.execute("SELECT nspname FROM pg_namespace;").collect { |row| row['nspname'] }
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.gsub('"', '') } }
|
20
|
-
|
21
|
-
it_should_behave_like "a generic apartment adapter"
|
22
|
-
it_should_behave_like "a schema based apartment adapter"
|
23
|
-
end
|
24
|
-
|
25
|
-
context "using databases" do
|
26
|
-
|
27
|
-
before { Apartment.use_schemas = false }
|
28
|
-
|
29
|
-
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
30
|
-
def tenant_names
|
31
|
-
connection.execute("select datname from pg_database;").collect { |row| row['datname'] }
|
32
|
-
end
|
33
|
-
|
34
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }
|
35
|
-
|
36
|
-
it_should_behave_like "a generic apartment adapter"
|
37
|
-
it_should_behave_like "a connection based apartment adapter"
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'apartment/adapters/mysql2_adapter'
|
3
|
-
|
4
|
-
describe Apartment::Adapters::Mysql2Adapter, database: :mysql do
|
5
|
-
unless defined?(JRUBY_VERSION)
|
6
|
-
|
7
|
-
subject(:adapter){ Apartment::Tenant.mysql2_adapter config }
|
8
|
-
|
9
|
-
def tenant_names
|
10
|
-
ActiveRecord::Base.connection.execute("SELECT schema_name FROM information_schema.schemata").collect { |row| row[0] }
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }
|
14
|
-
|
15
|
-
context "using - the equivalent of - schemas" do
|
16
|
-
before { Apartment.use_schemas = true }
|
17
|
-
|
18
|
-
it_should_behave_like "a generic apartment adapter"
|
19
|
-
|
20
|
-
describe "#default_tenant" do
|
21
|
-
it "is set to the original db from config" do
|
22
|
-
expect(subject.default_tenant).to eq(config[:database])
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#init" do
|
27
|
-
include Apartment::Spec::AdapterRequirements
|
28
|
-
|
29
|
-
before do
|
30
|
-
Apartment.configure do |config|
|
31
|
-
config.excluded_models = ["Company"]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
after do
|
36
|
-
# Apartment::Tenant.init creates per model connection.
|
37
|
-
# Remove the connection after testing not to unintentionally keep the connection across tests.
|
38
|
-
Apartment.excluded_models.each do |excluded_model|
|
39
|
-
excluded_model.constantize.remove_connection
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should process model exclusions" do
|
44
|
-
Apartment::Tenant.init
|
45
|
-
|
46
|
-
expect(Company.table_name).to eq("#{default_tenant}.companies")
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
context "using connections" do
|
52
|
-
before { Apartment.use_schemas = false }
|
53
|
-
|
54
|
-
it_should_behave_like "a generic apartment adapter"
|
55
|
-
it_should_behave_like "a generic apartment adapter able to handle custom configuration"
|
56
|
-
it_should_behave_like "a connection based apartment adapter"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'apartment/adapters/postgresql_adapter'
|
3
|
-
|
4
|
-
describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
|
5
|
-
unless defined?(JRUBY_VERSION)
|
6
|
-
|
7
|
-
subject{ Apartment::Tenant.postgresql_adapter config }
|
8
|
-
|
9
|
-
context "using schemas with schema.rb" do
|
10
|
-
|
11
|
-
before{ Apartment.use_schemas = true }
|
12
|
-
|
13
|
-
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
14
|
-
def tenant_names
|
15
|
-
ActiveRecord::Base.connection.execute("SELECT nspname FROM pg_namespace;").collect { |row| row['nspname'] }
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.gsub('"', '') } }
|
19
|
-
|
20
|
-
it_should_behave_like "a generic apartment adapter"
|
21
|
-
it_should_behave_like "a schema based apartment adapter"
|
22
|
-
end
|
23
|
-
|
24
|
-
context "using schemas with SQL dump" do
|
25
|
-
|
26
|
-
before{ Apartment.use_schemas = true; Apartment.use_sql = true }
|
27
|
-
|
28
|
-
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
29
|
-
def tenant_names
|
30
|
-
ActiveRecord::Base.connection.execute("SELECT nspname FROM pg_namespace;").collect { |row| row['nspname'] }
|
31
|
-
end
|
32
|
-
|
33
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.gsub('"', '') } }
|
34
|
-
|
35
|
-
it_should_behave_like "a generic apartment adapter"
|
36
|
-
it_should_behave_like "a schema based apartment adapter"
|
37
|
-
|
38
|
-
it 'allows for dashes in the schema name' do
|
39
|
-
expect { Apartment::Tenant.create('has-dashes') }.to_not raise_error
|
40
|
-
end
|
41
|
-
|
42
|
-
after { Apartment::Tenant.drop('has-dashes') if Apartment.connection.schema_exists? 'has-dashes' }
|
43
|
-
end
|
44
|
-
|
45
|
-
context "using connections" do
|
46
|
-
|
47
|
-
before{ Apartment.use_schemas = false }
|
48
|
-
|
49
|
-
# Not sure why, but somehow using let(:tenant_names) memoizes for the whole example group, not just each test
|
50
|
-
def tenant_names
|
51
|
-
connection.execute("select datname from pg_database;").collect { |row| row['datname'] }
|
52
|
-
end
|
53
|
-
|
54
|
-
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }
|
55
|
-
|
56
|
-
it_should_behave_like "a generic apartment adapter"
|
57
|
-
it_should_behave_like "a generic apartment adapter able to handle custom configuration"
|
58
|
-
it_should_behave_like "a connection based apartment adapter"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'apartment/adapters/sqlite3_adapter'
|
3
|
-
|
4
|
-
describe Apartment::Adapters::Sqlite3Adapter, database: :sqlite do
|
5
|
-
unless defined?(JRUBY_VERSION)
|
6
|
-
|
7
|
-
subject{ Apartment::Tenant.sqlite3_adapter config }
|
8
|
-
|
9
|
-
context "using connections" do
|
10
|
-
def tenant_names
|
11
|
-
db_dir = File.expand_path("../../dummy/db", __FILE__)
|
12
|
-
Dir.glob("#{db_dir}/*.sqlite3").map { |file| File.basename(file, '.sqlite3') }
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:default_tenant) do
|
16
|
-
subject.switch { File.basename(Apartment::Test.config['connections']['sqlite']['database'], '.sqlite3') }
|
17
|
-
end
|
18
|
-
|
19
|
-
it_should_behave_like "a generic apartment adapter"
|
20
|
-
it_should_behave_like "a connection based apartment adapter"
|
21
|
-
|
22
|
-
after(:all) do
|
23
|
-
File.delete(Apartment::Test.config['connections']['sqlite']['database'])
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
context "with prepend and append" do
|
28
|
-
let(:default_dir) { File.expand_path(File.dirname(config[:database])) }
|
29
|
-
describe "#prepend" do
|
30
|
-
let (:db_name) { "db_with_prefix" }
|
31
|
-
before do
|
32
|
-
Apartment.configure do |config|
|
33
|
-
config.prepend_environment = true
|
34
|
-
config.append_environment = false
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
after { subject.drop db_name rescue nil }
|
39
|
-
|
40
|
-
it "should create a new database" do
|
41
|
-
subject.create db_name
|
42
|
-
|
43
|
-
expect(File.exists?("#{default_dir}/#{Rails.env}_#{db_name}.sqlite3")).to eq true
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "#neither" do
|
48
|
-
let (:db_name) { "db_without_prefix_suffix" }
|
49
|
-
before do
|
50
|
-
Apartment.configure { |config| config.prepend_environment = config.append_environment = false }
|
51
|
-
end
|
52
|
-
|
53
|
-
after { subject.drop db_name rescue nil }
|
54
|
-
|
55
|
-
it "should create a new database" do
|
56
|
-
subject.create db_name
|
57
|
-
|
58
|
-
expect(File.exists?("#{default_dir}/#{db_name}.sqlite3")).to eq true
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "#append" do
|
63
|
-
let (:db_name) { "db_with_suffix" }
|
64
|
-
before do
|
65
|
-
Apartment.configure do |config|
|
66
|
-
config.prepend_environment = false
|
67
|
-
config.append_environment = true
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
after { subject.drop db_name rescue nil }
|
72
|
-
|
73
|
-
it "should create a new database" do
|
74
|
-
subject.create db_name
|
75
|
-
|
76
|
-
expect(File.exists?("#{default_dir}/#{db_name}_#{Rails.env}.sqlite3")).to eq true
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
data/spec/apartment_spec.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
<% if defined?(JRUBY_VERSION) %>
|
2
|
-
connections:
|
3
|
-
postgresql:
|
4
|
-
adapter: postgresql
|
5
|
-
database: apartment_postgresql_test
|
6
|
-
username: postgres
|
7
|
-
min_messages: WARNING
|
8
|
-
driver: org.postgresql.Driver
|
9
|
-
url: jdbc:postgresql://localhost:5432/apartment_postgresql_test
|
10
|
-
timeout: 5000
|
11
|
-
pool: 5
|
12
|
-
host: localhost
|
13
|
-
port: 5432
|
14
|
-
|
15
|
-
mysql:
|
16
|
-
adapter: mysql
|
17
|
-
database: apartment_mysql_test
|
18
|
-
username: root
|
19
|
-
min_messages: WARNING
|
20
|
-
driver: com.mysql.jdbc.Driver
|
21
|
-
url: jdbc:mysql://localhost:3306/apartment_mysql_test
|
22
|
-
timeout: 5000
|
23
|
-
pool: 5
|
24
|
-
host: 127.0.0.1
|
25
|
-
port: 3306
|
26
|
-
<% else %>
|
27
|
-
connections:
|
28
|
-
postgresql:
|
29
|
-
adapter: postgresql
|
30
|
-
database: apartment_postgresql_test
|
31
|
-
min_messages: WARNING
|
32
|
-
username: postgres
|
33
|
-
schema_search_path: public
|
34
|
-
password:
|
35
|
-
host: localhost
|
36
|
-
port: 5432
|
37
|
-
|
38
|
-
mysql:
|
39
|
-
adapter: mysql2
|
40
|
-
database: apartment_mysql_test
|
41
|
-
username: root
|
42
|
-
password:
|
43
|
-
host: 127.0.0.1
|
44
|
-
port: 3306
|
45
|
-
|
46
|
-
sqlite:
|
47
|
-
adapter: sqlite3
|
48
|
-
database: <%= File.expand_path('../spec/dummy/db', __FILE__) %>/default.sqlite3
|
49
|
-
<% end %>
|
data/spec/dummy/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
-
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
5
|
-
require 'rake'
|
6
|
-
|
7
|
-
Dummy::Application.load_tasks
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1>Index!!</h1>
|
data/spec/dummy/config.ru
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
2
|
-
|
3
|
-
require "active_model/railtie"
|
4
|
-
require "active_record/railtie"
|
5
|
-
require "action_controller/railtie"
|
6
|
-
require "action_view/railtie"
|
7
|
-
require "action_mailer/railtie"
|
8
|
-
|
9
|
-
Bundler.require
|
10
|
-
require "apartment"
|
11
|
-
|
12
|
-
module Dummy
|
13
|
-
class Application < Rails::Application
|
14
|
-
# Settings in config/environments/* take precedence over those specified here.
|
15
|
-
# Application configuration should go into files in config/initializers
|
16
|
-
# -- all .rb files in that directory are automatically loaded.
|
17
|
-
require 'apartment/elevators/subdomain'
|
18
|
-
require 'apartment/elevators/domain'
|
19
|
-
|
20
|
-
config.middleware.use Apartment::Elevators::Subdomain
|
21
|
-
|
22
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
23
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
24
|
-
|
25
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
26
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
27
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
28
|
-
|
29
|
-
# Activate observers that should always be running.
|
30
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
31
|
-
|
32
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
33
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
34
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
35
|
-
|
36
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
37
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
38
|
-
# config.i18n.default_locale = :de
|
39
|
-
|
40
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
41
|
-
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
42
|
-
|
43
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
44
|
-
config.encoding = "utf-8"
|
45
|
-
|
46
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
47
|
-
config.filter_parameters += [:password]
|
48
|
-
end
|
49
|
-
end
|
data/spec/dummy/config/boot.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# Warning: The database defined as "test" will be erased and
|
2
|
-
# re-generated from your development database when you run "rake".
|
3
|
-
# Do not set this db to the same as development or production.
|
4
|
-
<% if defined?(JRUBY_VERSION) %>
|
5
|
-
test:
|
6
|
-
adapter: postgresql
|
7
|
-
database: apartment_postgresql_test
|
8
|
-
username: postgres
|
9
|
-
min_messages: WARNING
|
10
|
-
driver: org.postgresql.Driver
|
11
|
-
url: jdbc:postgresql://localhost:5432/apartment_postgresql_test
|
12
|
-
timeout: 5000
|
13
|
-
pool: 5
|
14
|
-
|
15
|
-
development:
|
16
|
-
adapter: postgresql
|
17
|
-
database: apartment_postgresql_development
|
18
|
-
username: postgres
|
19
|
-
min_messages: WARNING
|
20
|
-
driver: org.postgresql.Driver
|
21
|
-
url: jdbc:postgresql://localhost:5432/apartment_postgresql_development
|
22
|
-
timeout: 5000
|
23
|
-
pool: 5
|
24
|
-
<% else %>
|
25
|
-
test:
|
26
|
-
adapter: postgresql
|
27
|
-
database: apartment_postgresql_test
|
28
|
-
username: postgres
|
29
|
-
min_messages: WARNING
|
30
|
-
pool: 5
|
31
|
-
timeout: 5000
|
32
|
-
host: localhost
|
33
|
-
port: 5432
|
34
|
-
|
35
|
-
development:
|
36
|
-
adapter: postgresql
|
37
|
-
database: apartment_postgresql_development
|
38
|
-
username: postgres
|
39
|
-
min_messages: WARNING
|
40
|
-
pool: 5
|
41
|
-
timeout: 5000
|
42
|
-
host: localhost
|
43
|
-
port: 5432
|
44
|
-
<% end %>
|