culturecode_stagehand 0.7.2 → 0.7.3
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.
- checksums.yaml +4 -4
- data/lib/stagehand/controller_extensions.rb +10 -2
- data/lib/stagehand/database.rb +1 -1
- data/lib/stagehand/version.rb +1 -1
- data/lib/tasks/stagehand_tasks.rake +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52ea6afe3b8d21f4df0bdea2a78b92d9c013151a
|
|
4
|
+
data.tar.gz: 87c189ec7bde9cd9a09c55e338b1179d6fd56a00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6860268a6a3eb5983622b2ddb0020ce472ad7ae73fbe96f3b043370162fd76054c6fe06366b2160b06ecc95c22d149bd065d627f630ab81d7e3140c95b36d10e
|
|
7
|
+
data.tar.gz: f18cfc88589e4f566b68a50806a53f87c32ecade90a04fd3c490e74336a253d856fa82aea6314f5e6fd0fb66297cd6a393eec2cc47383580b19afa5c0d035d60
|
|
@@ -17,11 +17,19 @@ module Stagehand
|
|
|
17
17
|
private
|
|
18
18
|
|
|
19
19
|
def use_staging_database(&block)
|
|
20
|
-
|
|
20
|
+
use_database(Configuration.staging_connection_name, &block)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def use_production_database(&block)
|
|
24
|
-
|
|
24
|
+
use_database(Configuration.production_connection_name, &block)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def use_database(connection_name, &block)
|
|
28
|
+
if Configuration.ghost_mode?
|
|
29
|
+
block.call
|
|
30
|
+
else
|
|
31
|
+
Database.with_connection(connection_name, &block)
|
|
32
|
+
end
|
|
25
33
|
end
|
|
26
34
|
end
|
|
27
35
|
end
|
data/lib/stagehand/database.rb
CHANGED
|
@@ -29,7 +29,7 @@ module Stagehand
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def with_connection(connection_name)
|
|
32
|
-
different =
|
|
32
|
+
different = current_connection_name != connection_name.to_sym
|
|
33
33
|
|
|
34
34
|
@@connection_name_stack.push(connection_name.to_sym)
|
|
35
35
|
Rails.logger.debug "Connecting to #{current_connection_name}"
|
data/lib/stagehand/version.rb
CHANGED
|
@@ -18,10 +18,11 @@ namespace :stagehand do
|
|
|
18
18
|
desc "Migrate both databases used by stagehand"
|
|
19
19
|
task :migrate => :environment do
|
|
20
20
|
[Rails.configuration.x.stagehand.staging_connection_name,
|
|
21
|
-
Rails.configuration.x.stagehand.production_connection_name].each do |
|
|
22
|
-
puts "Migrating #{
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
Rails.configuration.x.stagehand.production_connection_name].each do |connection_name|
|
|
22
|
+
puts "Migrating #{connection_name}"
|
|
23
|
+
Stagehand::Database.with_connection(connection_name) do
|
|
24
|
+
ActiveRecord::Migrator.migrate('db/migrate')
|
|
25
|
+
end
|
|
25
26
|
end
|
|
26
27
|
end
|
|
27
28
|
end
|
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.7.
|
|
4
|
+
version: 0.7.3
|
|
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-06-
|
|
12
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|