culturecode_stagehand 0.6.0 → 0.6.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.
- checksums.yaml +4 -4
- data/lib/stagehand/staging/controller.rb +1 -3
- data/lib/stagehand/staging/synchronizer.rb +13 -6
- 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: f7cfa0cf1edbaaa76472515b1b86e4c103b8aacf
|
4
|
+
data.tar.gz: aaf2c9b7a696a688a6a8759963fcb3a0d2f94691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8529f24f971523eabab56a7a65d98305710af009560eb25ece7723b0b810a71c285214a3797a664651aee7fc064feb00a251dd41f4754be773104bb24aac4703
|
7
|
+
data.tar.gz: 18b388a57b53be01172c87e048898c5541bfd831a3bdce61a5b4114b350a9a8d086fe2975275d49804b141f67119c4a301ed3880e87c522daae16a258e9f5a22
|
@@ -15,9 +15,7 @@ module Stagehand
|
|
15
15
|
|
16
16
|
# Syncs the given record and all affected records to the production database
|
17
17
|
def sync_record(record)
|
18
|
-
record
|
19
|
-
Stagehand::Staging::Synchronizer.sync_record(record)
|
20
|
-
end
|
18
|
+
Stagehand::Staging::Synchronizer.sync_record(record)
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
@@ -108,17 +108,20 @@ module Stagehand
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def sync_entries(entries)
|
111
|
-
return 0 if Configuration.single_connection? # Avoid deadlocking if the databases are the same
|
112
111
|
raise SchemaMismatch unless schemas_match?
|
113
112
|
|
114
113
|
entries = Array.wrap(entries)
|
115
114
|
|
116
115
|
entries.each do |entry|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
116
|
+
run_sync_callbacks(entry) do
|
117
|
+
Rails.logger.info "Synchronizing #{entry.table_name} #{entry.record_id}" if entry.content_operation?
|
118
|
+
if Configuration.single_connection?
|
119
|
+
next # Avoid deadlocking if the databases are the same
|
120
|
+
elsif entry.delete_operation?
|
121
|
+
Stagehand::Production.delete(entry)
|
122
|
+
elsif entry.save_operation?
|
123
|
+
Stagehand::Production.save(entry)
|
124
|
+
end
|
122
125
|
end
|
123
126
|
end
|
124
127
|
|
@@ -135,6 +138,10 @@ module Stagehand
|
|
135
138
|
|
136
139
|
return schemas_match
|
137
140
|
end
|
141
|
+
|
142
|
+
def run_sync_callbacks(entry, &block)
|
143
|
+
entry.record.run_callbacks(:sync, &block) if entry.record
|
144
|
+
end
|
138
145
|
end
|
139
146
|
end
|
140
147
|
|
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.6.
|
4
|
+
version: 0.6.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-04-
|
12
|
+
date: 2016-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.4.
|
111
|
+
rubygems_version: 2.4.6
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Simplify the management of a sandbox database that can sync content to a
|