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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.pryrc +5 -3
  3. data/.rubocop.yml +22 -0
  4. data/.rubocop_todo.yml +29 -0
  5. data/.story_branch.yml +5 -0
  6. data/.travis.yml +20 -36
  7. data/Appraisals +16 -29
  8. data/Gemfile +5 -2
  9. data/Guardfile +3 -1
  10. data/HISTORY.md +57 -0
  11. data/README.md +64 -21
  12. data/Rakefile +36 -22
  13. data/TODO.md +0 -1
  14. data/apartment.gemspec +17 -10
  15. data/gemfiles/rails_4_2.gemfile +12 -10
  16. data/gemfiles/rails_5_0.gemfile +2 -1
  17. data/gemfiles/rails_5_1.gemfile +2 -1
  18. data/gemfiles/rails_5_2.gemfile +2 -1
  19. data/gemfiles/rails_6_0.gemfile +6 -5
  20. data/gemfiles/rails_master.gemfile +2 -1
  21. data/lib/apartment.rb +38 -14
  22. data/lib/apartment/active_record/connection_handling.rb +17 -0
  23. data/lib/apartment/active_record/internal_metadata.rb +11 -0
  24. data/lib/apartment/active_record/log_subscriber.rb +41 -0
  25. data/lib/apartment/active_record/schema_migration.rb +13 -0
  26. data/lib/apartment/adapters/abstract_adapter.rb +49 -45
  27. data/lib/apartment/adapters/abstract_jdbc_adapter.rb +4 -3
  28. data/lib/apartment/adapters/jdbc_mysql_adapter.rb +3 -3
  29. data/lib/apartment/adapters/jdbc_postgresql_adapter.rb +20 -13
  30. data/lib/apartment/adapters/mysql2_adapter.rb +12 -9
  31. data/lib/apartment/adapters/postgis_adapter.rb +3 -2
  32. data/lib/apartment/adapters/postgresql_adapter.rb +59 -27
  33. data/lib/apartment/adapters/sqlite3_adapter.rb +18 -8
  34. data/lib/apartment/console.rb +35 -3
  35. data/lib/apartment/custom_console.rb +42 -0
  36. data/lib/apartment/deprecation.rb +2 -1
  37. data/lib/apartment/elevators/domain.rb +4 -3
  38. data/lib/apartment/elevators/first_subdomain.rb +3 -2
  39. data/lib/apartment/elevators/generic.rb +4 -3
  40. data/lib/apartment/elevators/host.rb +6 -1
  41. data/lib/apartment/elevators/host_hash.rb +6 -2
  42. data/lib/apartment/elevators/subdomain.rb +9 -5
  43. data/lib/apartment/migrator.rb +4 -3
  44. data/lib/apartment/model.rb +27 -0
  45. data/lib/apartment/railtie.rb +27 -15
  46. data/lib/apartment/reloader.rb +2 -1
  47. data/lib/apartment/tasks/enhancements.rb +4 -6
  48. data/lib/apartment/tasks/task_helper.rb +35 -0
  49. data/lib/apartment/tenant.rb +19 -9
  50. data/lib/apartment/version.rb +3 -1
  51. data/lib/generators/apartment/install/install_generator.rb +4 -3
  52. data/lib/generators/apartment/install/templates/apartment.rb +8 -2
  53. data/lib/tasks/apartment.rake +22 -44
  54. metadata +51 -230
  55. data/spec/adapters/jdbc_mysql_adapter_spec.rb +0 -19
  56. data/spec/adapters/jdbc_postgresql_adapter_spec.rb +0 -41
  57. data/spec/adapters/mysql2_adapter_spec.rb +0 -59
  58. data/spec/adapters/postgresql_adapter_spec.rb +0 -61
  59. data/spec/adapters/sqlite3_adapter_spec.rb +0 -83
  60. data/spec/apartment_spec.rb +0 -11
  61. data/spec/config/database.yml.sample +0 -49
  62. data/spec/dummy/Rakefile +0 -7
  63. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  64. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  65. data/spec/dummy/app/models/company.rb +0 -3
  66. data/spec/dummy/app/models/user.rb +0 -3
  67. data/spec/dummy/app/views/application/index.html.erb +0 -1
  68. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  69. data/spec/dummy/config.ru +0 -4
  70. data/spec/dummy/config/application.rb +0 -49
  71. data/spec/dummy/config/boot.rb +0 -11
  72. data/spec/dummy/config/database.yml.sample +0 -44
  73. data/spec/dummy/config/environment.rb +0 -5
  74. data/spec/dummy/config/environments/development.rb +0 -28
  75. data/spec/dummy/config/environments/production.rb +0 -51
  76. data/spec/dummy/config/environments/test.rb +0 -34
  77. data/spec/dummy/config/initializers/apartment.rb +0 -4
  78. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  79. data/spec/dummy/config/initializers/inflections.rb +0 -10
  80. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  81. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  82. data/spec/dummy/config/initializers/session_store.rb +0 -8
  83. data/spec/dummy/config/locales/en.yml +0 -5
  84. data/spec/dummy/config/routes.rb +0 -3
  85. data/spec/dummy/db/migrate/20110613152810_create_dummy_models.rb +0 -39
  86. data/spec/dummy/db/migrate/20111202022214_create_table_books.rb +0 -14
  87. data/spec/dummy/db/migrate/20180415260934_create_public_tokens.rb +0 -13
  88. data/spec/dummy/db/schema.rb +0 -55
  89. data/spec/dummy/db/seeds.rb +0 -5
  90. data/spec/dummy/db/seeds/import.rb +0 -5
  91. data/spec/dummy/public/404.html +0 -26
  92. data/spec/dummy/public/422.html +0 -26
  93. data/spec/dummy/public/500.html +0 -26
  94. data/spec/dummy/public/favicon.ico +0 -0
  95. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  96. data/spec/dummy/script/rails +0 -6
  97. data/spec/dummy_engine/.gitignore +0 -8
  98. data/spec/dummy_engine/Gemfile +0 -15
  99. data/spec/dummy_engine/Rakefile +0 -34
  100. data/spec/dummy_engine/bin/rails +0 -12
  101. data/spec/dummy_engine/config/initializers/apartment.rb +0 -51
  102. data/spec/dummy_engine/dummy_engine.gemspec +0 -24
  103. data/spec/dummy_engine/lib/dummy_engine.rb +0 -4
  104. data/spec/dummy_engine/lib/dummy_engine/engine.rb +0 -4
  105. data/spec/dummy_engine/lib/dummy_engine/version.rb +0 -3
  106. data/spec/dummy_engine/test/dummy/Rakefile +0 -6
  107. data/spec/dummy_engine/test/dummy/config.ru +0 -4
  108. data/spec/dummy_engine/test/dummy/config/application.rb +0 -22
  109. data/spec/dummy_engine/test/dummy/config/boot.rb +0 -5
  110. data/spec/dummy_engine/test/dummy/config/database.yml +0 -25
  111. data/spec/dummy_engine/test/dummy/config/environment.rb +0 -5
  112. data/spec/dummy_engine/test/dummy/config/environments/development.rb +0 -37
  113. data/spec/dummy_engine/test/dummy/config/environments/production.rb +0 -78
  114. data/spec/dummy_engine/test/dummy/config/environments/test.rb +0 -39
  115. data/spec/dummy_engine/test/dummy/config/initializers/assets.rb +0 -8
  116. data/spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  117. data/spec/dummy_engine/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  118. data/spec/dummy_engine/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  119. data/spec/dummy_engine/test/dummy/config/initializers/inflections.rb +0 -16
  120. data/spec/dummy_engine/test/dummy/config/initializers/mime_types.rb +0 -4
  121. data/spec/dummy_engine/test/dummy/config/initializers/session_store.rb +0 -3
  122. data/spec/dummy_engine/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  123. data/spec/dummy_engine/test/dummy/config/locales/en.yml +0 -23
  124. data/spec/dummy_engine/test/dummy/config/routes.rb +0 -56
  125. data/spec/dummy_engine/test/dummy/config/secrets.yml +0 -22
  126. data/spec/examples/connection_adapter_examples.rb +0 -42
  127. data/spec/examples/generic_adapter_custom_configuration_example.rb +0 -95
  128. data/spec/examples/generic_adapter_examples.rb +0 -163
  129. data/spec/examples/schema_adapter_examples.rb +0 -234
  130. data/spec/integration/apartment_rake_integration_spec.rb +0 -107
  131. data/spec/integration/query_caching_spec.rb +0 -81
  132. data/spec/integration/use_within_an_engine_spec.rb +0 -28
  133. data/spec/schemas/v1.rb +0 -16
  134. data/spec/schemas/v2.rb +0 -43
  135. data/spec/schemas/v3.rb +0 -49
  136. data/spec/spec_helper.rb +0 -61
  137. data/spec/support/apartment_helpers.rb +0 -43
  138. data/spec/support/capybara_sessions.rb +0 -15
  139. data/spec/support/config.rb +0 -10
  140. data/spec/support/contexts.rb +0 -52
  141. data/spec/support/requirements.rb +0 -35
  142. data/spec/support/setup.rb +0 -46
  143. data/spec/tasks/apartment_rake_spec.rb +0 -129
  144. data/spec/tenant_spec.rb +0 -190
  145. data/spec/unit/config_spec.rb +0 -112
  146. data/spec/unit/elevators/domain_spec.rb +0 -32
  147. data/spec/unit/elevators/first_subdomain_spec.rb +0 -24
  148. data/spec/unit/elevators/generic_spec.rb +0 -54
  149. data/spec/unit/elevators/host_hash_spec.rb +0 -32
  150. data/spec/unit/elevators/host_spec.rb +0 -89
  151. data/spec/unit/elevators/subdomain_spec.rb +0 -76
  152. data/spec/unit/migrator_spec.rb +0 -77
  153. 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
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Apartment do
4
- it "should be valid" do
5
- expect(Apartment).to be_a(Module)
6
- end
7
-
8
- it "should be a valid app" do
9
- expect(::Rails.application).to be_a(Dummy::Application)
10
- end
11
- end
@@ -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 %>
@@ -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,6 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
-
4
- def index
5
- end
6
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,3 +0,0 @@
1
- class Company < ActiveRecord::Base
2
- # Dummy models
3
- end
@@ -1,3 +0,0 @@
1
- class User < ActiveRecord::Base
2
- # Dummy models
3
- end
@@ -1 +0,0 @@
1
- <h1>Index!!</h1>
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag :all %>
6
- <%= javascript_include_tag :defaults %>
7
- <%= csrf_meta_tag %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -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
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
-
3
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
4
-
5
- if File.exist?(gemfile)
6
- ENV['BUNDLE_GEMFILE'] = gemfile
7
- require 'bundler'
8
- Bundler.setup
9
- end
10
-
11
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -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 %>