culturecode_stagehand 0.7.7 → 0.7.8

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: 1861fc3a02203ebab5d3564e539f075696507126
4
- data.tar.gz: aa63f9de3c39afcea634c3b29797fdfde3e7cef6
3
+ metadata.gz: b324664a437db0ce9781e477ba4a097c9e6f96f9
4
+ data.tar.gz: 8c926f3d008e7cbff56ef1efca2c86ba80153d55
5
5
  SHA512:
6
- metadata.gz: cabf6017f79933f3c395e1ba85601473c65a31f51e32003acd8af2615e32a65fd69b968238e4ad39f1c963c66024bc0fb271d77aa29da18447420845f10d5ba0
7
- data.tar.gz: 45fcd03db08c98b81cac61d42cc7e1ef761f94d7c73f1259f1bf08feae3f7825c8e810baca4b25d785ef1e802070fd22bb51f7f51d0e6145ccb0bc3d93c9cd07
6
+ metadata.gz: 44a2aba03a1dfba9f3d8e12047dedd0c36ad0d5948ccd7acc91f441ba8944853c978513bd42ac6014d0663badb75a4b7c77d770d7aa387e36f8c970f303196cf
7
+ data.tar.gz: 56d0d822a9632dbcb0e830d67b0b0e89a886e0d621f155ebc220eff09ac52e13df9d1c03da687423e5606c555b9f955ae718d01ec0811d00bfb2c59ee0a29c51
@@ -1,3 +1,3 @@
1
1
  module Stagehand
2
- VERSION = "0.7.7"
2
+ VERSION = "0.7.8"
3
3
  end
@@ -11,21 +11,33 @@ namespace :stagehand do
11
11
  end
12
12
 
13
13
  desc "Syncs all records to production, including those that require confirmation"
14
- task :sync_all, :environment do
14
+ task :sync_all => :environment do
15
15
  Stagehand::Staging::Synchronizer.sync_all
16
16
  end
17
17
 
18
18
  desc "Migrate both databases used by stagehand"
19
19
  task :migrate => :environment do
20
- connections = [Stagehand.configuration.staging_connection_name, Stagehand.configuration.production_connection_name]
21
- connections.compact.uniq.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
20
+ run_on_both_databases do
21
+ ActiveRecord::Migrator.migrate('db/migrate')
26
22
  end
27
23
  end
24
+
25
+ desc "Rollback both databases used by stagehand"
26
+ task :rollback => :environment do
27
+ run_on_both_databases do
28
+ ActiveRecord::Migrator.rollback("db/migrate")
29
+ end
30
+ end
31
+ end
32
+
33
+ def run_on_both_databases(&block)
34
+ connections = [Stagehand.configuration.staging_connection_name, Stagehand.configuration.production_connection_name]
35
+ connections.compact.uniq.each do |connection_name|
36
+ puts "#{connection_name}"
37
+ Stagehand::Database.with_connection(connection_name, &block)
38
+ end
28
39
  end
29
40
 
30
- # Enhance the regular db:migrate task to run the stagehand migration task so both stagehand databases are migrated
31
- Rake::Task['db:migrate'].enhance(['stagehand:migrate'])
41
+ # Enhance the regular db:migrate/db:rollback tasks to run the stagehand migration/rollback tasks so both stagehand databases are migrated
42
+ Rake::Task['db:migrate'].clear.enhance(['stagehand:migrate'])
43
+ Rake::Task['db:rollback'].clear.enhance(['stagehand:rollback'])
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.7
4
+ version: 0.7.8
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-25 00:00:00.000000000 Z
12
+ date: 2016-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails