rails_multisite 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_multisite might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9125f561ab7f58fb9685d8a1ef7501add2dc2617
4
- data.tar.gz: 6e1cda42fb46f76466b3828fd7f8a7c27054dc34
3
+ metadata.gz: f7e2c205099ae33332f61e37a6d3f332a3c2ae53
4
+ data.tar.gz: 8d999119d228ae6fbff1034276f3182e668bec5d
5
5
  SHA512:
6
- metadata.gz: 20bbec27a4d049bb250257bf6b3c3a354ff70617cac6eec973a1a64a8e888bea80ddfd9e169a1612d273059b20bb1400e22bbdd639c90e26d0c22ad80f5b4444
7
- data.tar.gz: 37fa6cdbe00e7d32e20d8b10bac38e4f02350f3c6a2dd18f651c664caedebd3a8ea50e03143e0fcb57f7fb88b56a6f9063fd2af0b39eb69f7af0aad4824ad88e
6
+ metadata.gz: 3a63767fe5db853f5ae53722cd821847dbd86d947fcdd900c2f7bd2076e9a6f3613ef07a24a244c856b83f049c8d85f94061d34e8ba321d9a7632f69cca4013b
7
+ data.tar.gz: e975e2ca70ab0c9bfbdd4761c311cbd9dc8983788594cd77910ee2dfeba8e1eebb0d1bca0c195b5b50d43d85cb17417d82233147a47c7409764909b616e5ba7a
data/README.md CHANGED
@@ -48,7 +48,7 @@ drwho:
48
48
  host: dbhost
49
49
  pool: 5
50
50
  timeout: 5000
51
- db_id: 2# ensure db_id is unique for each site
51
+ db_id: 2 # ensure db_id is unique for each site
52
52
  host_names:
53
53
  - discuss.tardis.gallifrey
54
54
  ```
@@ -180,9 +180,8 @@ module RailsMultisite
180
180
  v[:prepared_statements] = false if no_prepared_statements
181
181
  end
182
182
 
183
- @@db_spec_cache = Hash[*configs.map do |k, data|
184
- [k, spec_klass::Resolver.new(configs).spec(k)]
185
- end.flatten]
183
+ resolver = spec_klass::Resolver.new(configs)
184
+ @@db_spec_cache = Hash[*configs.map { |k, _| [k, resolver.spec(k.to_sym)] }.flatten]
186
185
 
187
186
  @@host_spec_cache = {}
188
187
  configs.each do |k,v|
@@ -192,7 +191,7 @@ module RailsMultisite
192
191
  end
193
192
  end
194
193
 
195
- @@default_spec = spec_klass::Resolver.new(ActiveRecord::Base.configurations).spec(Rails.env)
194
+ @@default_spec = spec_klass::Resolver.new(ActiveRecord::Base.configurations).spec(Rails.env.to_sym)
196
195
  ActiveRecord::Base.configurations[Rails.env]["host_names"].each do |host|
197
196
  @@host_spec_cache[host] = @@default_spec
198
197
  end
@@ -1,5 +1,7 @@
1
1
  module RailsMultisite
2
2
  class Formatter < ::ActiveSupport::Logger::SimpleFormatter
3
+ include ::ActiveSupport::TaggedLogging::Formatter
4
+
3
5
  def call(severity, timestamp, progname, msg)
4
6
  "[#{RailsMultisite::ConnectionManagement.current_db}] #{super}"
5
7
  end
@@ -13,7 +13,7 @@ module RailsMultisite
13
13
  app.middleware.insert_after(ActiveRecord::ConnectionAdapters::ConnectionManagement, RailsMultisite::ConnectionManagement)
14
14
  app.middleware.delete(ActiveRecord::ConnectionAdapters::ConnectionManagement)
15
15
  if ENV['RAILS_DB']
16
- ConnectionManagement.establish_connection(:db => ENV['RAILS_DB'])
16
+ ConnectionManagement.establish_connection(db: ENV['RAILS_DB'].to_sym)
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module RailsMultisite
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_multisite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
13
33
  description: Multi tenancy support for Rails
14
34
  email:
15
35
  - sam.saffron@gmail.com
@@ -45,9 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
65
  version: '0'
46
66
  requirements: []
47
67
  rubyforge_project:
48
- rubygems_version: 2.5.1
68
+ rubygems_version: 2.6.7
49
69
  signing_key:
50
70
  specification_version: 4
51
71
  summary: Multi tenancy support for Rails
52
72
  test_files: []
53
- has_rdoc: