culturecode_stagehand 0.10.1 → 0.10.2

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: 198fa7c00c0c7374576db8bc52a5e3263a0d7960
4
- data.tar.gz: ba863f7b3aab4b7c969d3de8c718e932fab1af67
3
+ metadata.gz: bd8d168cfca3a30f6904f1f84fc27d7eec96d5d5
4
+ data.tar.gz: 4ae03b6e5e13aed6c1d13d85e5dc2fe3470dec26
5
5
  SHA512:
6
- metadata.gz: 7dc0bf126e23ce4bfbf77eff18924e894bfd660b716f329c0bbb611cd92b44d383183ccbe4431e59a0ca2beed3f4a5baa30283fac15b801c8cc48d5e8b9f4ff8
7
- data.tar.gz: 8f285239f66c670aa4d42ef99d9f870ba7b63d915fd83b5e52d50dc84a3063eb7900e67b6f3da99899dfe947f672628a917f3af22184351ebb05fba85d87f456
6
+ metadata.gz: cb78f8ebdb79f4b9441cf79ecf81577428efe58a90cfd664f6f8ed5716c5b2984098fb3575c8d25859c06b728d4c53140ba006a510bec5bfdb65fbd16f81e097
7
+ data.tar.gz: 18f250b45b7f14dc3437c6121766c1215b8aeaf1b5b84225990732962ce70483621880d04278503cfb2b73d43bb44d2dff7621c12bd02127391dd1f0dcd1b3e1
@@ -95,10 +95,9 @@ module Stagehand
95
95
 
96
96
  public
97
97
 
98
- def initialize(subject, preconfirm_subject: true, &confirmation_filter)
98
+ def initialize(subject, &confirmation_filter)
99
99
  @subject = subject
100
100
  @confirmation_filter = confirmation_filter
101
- @preconfirm_subject = preconfirm_subject
102
101
  affected_entries # Init the affected_entries changes can be rolled back without affecting the checklist
103
102
  end
104
103
 
@@ -146,21 +145,24 @@ module Stagehand
146
145
 
147
146
  def grouped_required_confirmation_entries
148
147
  cache(:grouped_required_confirmation_entries) do
149
- staging_record_start_operation_ids = affected_entries.select do |entry|
150
- entry.start_operation? && entry.matches?(@subject)
151
- end.collect(&:id)
152
-
153
148
  entries = affected_entries.dup
154
-
155
- # Don't need to confirm entries that match the checklist subject
156
- entries.reject! {|entry| entry.matches?(@subject) } if @preconfirm_subject
157
-
158
- # Don't need to confirm entries that are part of a commits whose subject is the checklist subject
159
- entries.reject! {|entry| staging_record_start_operation_ids.include?(entry.commit_id) }
149
+ subject_entries, subject_records = Array.wrap(@subject).partition {|model| model.is_a?(CommitEntry) }
160
150
 
161
151
  # Don't need to confirm entries that were not part of a commit
162
152
  entries.select!(&:commit_id)
163
153
 
154
+ # Don't need to confirm entries that exactly match a subject commit entry
155
+ entries -= subject_entries
156
+
157
+ # Don't need to confirm entries that match the checklist subject records
158
+ entries.reject! {|entry| entry.matches?(subject_records) }
159
+
160
+ # Don't need to confirm entries that are part of a commits whose subject is a checklist subject record
161
+ staging_record_start_operation_ids = affected_entries.select do |entry|
162
+ entry.start_operation? && entry.matches?(subject_records)
163
+ end.collect(&:id)
164
+ entries.reject! {|entry| staging_record_start_operation_ids.include?(entry.commit_id) }
165
+
164
166
  entries = self.class.compact_entries(entries)
165
167
  entries = filter_entries(entries)
166
168
  entries = self.class.group_entries(entries)
@@ -13,7 +13,7 @@ module Stagehand
13
13
  raise SyncBlockRequired unless block_given?
14
14
 
15
15
  Database.transaction do
16
- checklist = Checklist.new(Commit.capture(subject_record, &block).entries, :preconfirm_subject => false)
16
+ checklist = Checklist.new(Commit.capture(subject_record, &block).entries)
17
17
  sync_checklist(checklist) unless checklist.requires_confirmation?
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Stagehand
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  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.10.1
4
+ version: 0.10.2
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-10-07 00:00:00.000000000 Z
12
+ date: 2016-11-02 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.4.5.1
112
+ rubygems_version: 2.6.7
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