culturecode_stagehand 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stagehand/database.rb +11 -7
- data/lib/stagehand/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198fa7c00c0c7374576db8bc52a5e3263a0d7960
|
4
|
+
data.tar.gz: ba863f7b3aab4b7c969d3de8c718e932fab1af67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc0bf126e23ce4bfbf77eff18924e894bfd660b716f329c0bbb611cd92b44d383183ccbe4431e59a0ca2beed3f4a5baa30283fac15b801c8cc48d5e8b9f4ff8
|
7
|
+
data.tar.gz: 8f285239f66c670aa4d42ef99d9f870ba7b63d915fd83b5e52d50dc84a3063eb7900e67b6f3da99899dfe947f672628a917f3af22184351ebb05fba85d87f456
|
data/lib/stagehand/database.rb
CHANGED
@@ -5,8 +5,8 @@ module Stagehand
|
|
5
5
|
@@connection_name_stack = [Rails.env.to_sym]
|
6
6
|
|
7
7
|
def each(&block)
|
8
|
-
with_staging_connection(&block)
|
9
8
|
with_production_connection(&block) unless Configuration.single_connection?
|
9
|
+
with_staging_connection(&block)
|
10
10
|
end
|
11
11
|
|
12
12
|
def connected_to_production?
|
@@ -52,15 +52,19 @@ module Stagehand
|
|
52
52
|
def with_connection(connection_name)
|
53
53
|
different = current_connection_name != connection_name.to_sym
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
if different
|
56
|
+
@@connection_name_stack.push(connection_name.to_sym)
|
57
|
+
Rails.logger.debug "Connecting to #{current_connection_name}"
|
58
|
+
connect_to(current_connection_name)
|
59
|
+
end
|
58
60
|
|
59
61
|
yield connection_name
|
60
62
|
ensure
|
61
|
-
|
62
|
-
|
63
|
-
|
63
|
+
if different
|
64
|
+
@@connection_name_stack.pop
|
65
|
+
Rails.logger.debug "Restoring connection to #{current_connection_name}"
|
66
|
+
connect_to(current_connection_name)
|
67
|
+
end
|
64
68
|
end
|
65
69
|
|
66
70
|
def transaction
|
data/lib/stagehand/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: culturecode_stagehand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Jakobsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.5.1
|
112
|
+
rubygems_version: 2.4.5.1
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Simplify the management of a sandbox database that can sync content to a
|