shackles 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a69564d49b648b3d2a4ff5b5c5c3d69c0e32239
4
- data.tar.gz: 0dabf823afc9141faa5089be875a55c300bb22f8
3
+ metadata.gz: 4692b2c9a32072b9a591234bad820ad8845a13af
4
+ data.tar.gz: 34809b1f70d5741b40688bd59f2fe9c2d94fa88a
5
5
  SHA512:
6
- metadata.gz: b2cd537e44ee955172d4c849fa88c3dd6439e66020906d5c436fdd7db6371edb5c761728c4650eb87a4535ce3c60c975fd80c355169a0b9117b1a66aa1a689ee
7
- data.tar.gz: 7f564cf199a5a239c32438406c92a209f9dec1365e47767b1e393f0e97894e3e806f194ca39e1dcfe7728a125ffa0b00da23ded3ec494dc810986e53de9b9f6f
6
+ metadata.gz: '09955aed6683cadf221f6cd3b461528b7250e84fa2754c06108d9c8bb31b550af95795c4f35e49ffaf7914aefc5b35d1e4784cfadf9112784cdb757ab5bfcf8a'
7
+ data.tar.gz: 89a7a2bf11d701f900c8f6020e25d4f3a10641f467625dadb7d0b22c706299f4e070f0a7519cfb9e724ea53901007bb845b6708390be08551d314caedda2ef2f
@@ -1,7 +1,9 @@
1
1
  module Shackles
2
2
  module HelperMethods
3
3
  def self.included(base)
4
- base.extend(ClassMethods)
4
+ base.singleton_class.include(ClassMethods)
5
+ # call shackle_class_method on the class itself, which then calls shackle_method on the singleton_class
6
+ base.singleton_class.singleton_class.include(ClassMethods)
5
7
  end
6
8
 
7
9
  # see readme for example usage
@@ -1,3 +1,3 @@
1
1
  module Shackles
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
data/lib/shackles.rb CHANGED
@@ -93,8 +93,10 @@ module Shackles
93
93
  if Rails.version < '5'
94
94
  model = model.constantize
95
95
  new_handler.establish_connection(model, pool.spec)
96
- else
96
+ elsif Rails.version < '5.1'
97
97
  new_handler.establish_connection(pool.spec)
98
+ else
99
+ new_handler.establish_connection(pool.spec.config)
98
100
  end
99
101
  end
100
102
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shackles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.1'
22
+ version: '5.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.1'
32
+ version: '5.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: railties
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '4.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '5.1'
42
+ version: '5.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '4.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '5.1'
52
+ version: '5.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: appraisal
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -156,10 +156,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.6.4
159
+ rubygems_version: 2.6.11
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: ActiveRecord database environment switching for slaves and least-privilege
163
163
  test_files:
164
164
  - spec/shackles_spec.rb
165
- has_rdoc: