shackles 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/shackles/connection_specification.rb +11 -1
- data/lib/shackles/version.rb +1 -1
- metadata +2 -2
@@ -19,6 +19,11 @@ module Shackles
|
|
19
19
|
|
20
20
|
def self.included(klass)
|
21
21
|
klass.send(:remove_method, :config)
|
22
|
+
klass.alias_method_chain :initialize, :deep_symbolize
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize_with_deep_symbolize(config, adapter_method)
|
26
|
+
initialize_without_deep_symbolize(config.deep_symbolize_keys, adapter_method)
|
22
27
|
end
|
23
28
|
|
24
29
|
def config
|
@@ -29,7 +34,12 @@ module Shackles
|
|
29
34
|
@current_config_sequence = Shackles.global_config_sequence
|
30
35
|
config = @config.dup
|
31
36
|
if @config.has_key?(Shackles.environment)
|
32
|
-
|
37
|
+
env_config = @config[Shackles.environment]
|
38
|
+
# an array of databases for this environment; for now, just choose the first non-nil element
|
39
|
+
if env_config.is_a?(Array)
|
40
|
+
env_config = env_config.detect { |individual_config| !individual_config.nil? }
|
41
|
+
end
|
42
|
+
config.merge!(env_config.symbolize_keys)
|
33
43
|
end
|
34
44
|
|
35
45
|
config.keys.each do |key|
|
data/lib/shackles/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shackles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|