rails_multisite 1.1.1 → 1.1.2

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: 46f1af53002fa575bb2ef12f53aedb834bd146f7
4
- data.tar.gz: 16a65e7ea6a754641070e3867388082f447e0c82
3
+ metadata.gz: 996ac1e0d01f6f24f9d3ed47e89bca743b49b11c
4
+ data.tar.gz: f0bd440331fad84e9272b4e1727db7c3f12bf34a
5
5
  SHA512:
6
- metadata.gz: 583ec55ba16263a8c9e442cb405bd3f74cbb4825e556a9df0307c38a0f331a601702e22b3d647e343d2bd856c8b94f76a4d223b3b87b21cd9eb3d58f0b2b0e1f
7
- data.tar.gz: 19ec7b4f342e3b940be2ee5951cc038dcca679c01628de691a460d9d168f2cd07cee8a79113fd1499c5820de213558d958c73c9e217c2388ff0a02a55d42291d
6
+ metadata.gz: 1baf84b410cf26fcc2a053c2fb644d144125a87be633469d6113b114da8f7c8c18f1c5aa81abeb2788d6ff45ad0285b24469a480754119ceb3a05e92047a2f36
7
+ data.tar.gz: 070f97d29cba5729b71aeb5e2c159dd9b6ddb85c65d20cc6dfe10423496cbbda0f8dd1e5a2e4562ffa4b91f7992489ba6057d7b4ed812d89888b740eb3e5838e
@@ -20,7 +20,11 @@ module RailsMultisite
20
20
  if opts[:db] == DEFAULT && (!defined?(@@default_spec) || !@@default_spec)
21
21
  # don't do anything .. handled implicitly
22
22
  else
23
- spec = connection_spec(opts) || @@default_spec
23
+ spec = connection_spec(opts)
24
+ if (!spec && opts[:raise_on_missing])
25
+ raise "ERROR: #{opts[:db]} not found!"
26
+ end
27
+ spec ||= @@default_spec
24
28
  handler = nil
25
29
  if spec != @@default_spec
26
30
  handler = @@connection_handlers[spec]
@@ -16,8 +16,8 @@ module RailsMultisite
16
16
  app.middleware.insert_after(ActionDispatch::Executor, RailsMultisite::ConnectionManagement)
17
17
  app.middleware.delete(ActionDispatch::Executor)
18
18
 
19
- if ENV['RAILS_DB']
20
- ConnectionManagement.establish_connection(db: ENV['RAILS_DB'])
19
+ if ENV['RAILS_DB'].present?
20
+ ConnectionManagement.establish_connection(db: ENV['RAILS_DB'], raise_on_missing: true)
21
21
  end
22
22
  else
23
23
  ConnectionManagement.set_current_db
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_multisite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-09 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord