counter_culture 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/counter_culture/counter.rb +1 -1
- data/lib/counter_culture/reconciler.rb +3 -3
- data/lib/counter_culture/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d29aaa4f5707919469b563c27c2d78b3f188d9aa4b064e1fb6590546095ee951
|
4
|
+
data.tar.gz: 683692c14e1ac6b37ed31f9d18f911bf517e859630aebdbd352ae69fa552f63a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4316fd30adc6c1ea052f9962e1c40baf4806b5cb016fab75e6cd202add290a495dfc8d83573e47d663032fc5d4b1f193d7b6b5cd211c7cce98802c6528fea2d
|
7
|
+
data.tar.gz: ec4573685944d69be763bbb9237029ff2c18fe657930e9dccd4c26036b1662b938c55bc69fc59bd1adb6b7f1430c8381c94ceaa730fac8c1e7bf3786a252a1c4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 2.6.0 (July 29, 2020)
|
2
|
+
|
3
|
+
Improvements:
|
4
|
+
- Use []= method instead of attribute writer method internally to avoid conflicts with read-only attributes (#287)
|
5
|
+
- More detailed logging when performing reconciliation (#288)
|
6
|
+
|
1
7
|
## 2.5.1 (May 18, 2020)
|
2
8
|
|
3
9
|
Bugfixes:
|
@@ -290,7 +290,7 @@ module CounterCulture
|
|
290
290
|
changes_method = ACTIVE_RECORD_VERSION >= Gem::Version.new("5.1.0") ? :saved_changes : :changed_attributes
|
291
291
|
obj.public_send(changes_method).each do |key, value|
|
292
292
|
old_value = ACTIVE_RECORD_VERSION >= Gem::Version.new("5.1.0") ? value.first : value
|
293
|
-
prev
|
293
|
+
prev[key] = old_value
|
294
294
|
end
|
295
295
|
|
296
296
|
prev
|
@@ -109,9 +109,11 @@ module CounterCulture
|
|
109
109
|
find_in_batches_args[:start] = options[:start] if options[:start].present?
|
110
110
|
find_in_batches_args[:finish] = options[:finish] if options[:finish].present?
|
111
111
|
|
112
|
-
counts_query.find_in_batches(find_in_batches_args) do |records|
|
112
|
+
counts_query.find_in_batches(find_in_batches_args).with_index(1) do |records, index|
|
113
|
+
log "Processing batch ##{index}."
|
113
114
|
# now iterate over all the models and see whether their counts are right
|
114
115
|
update_count_for_batch(column_name, records)
|
116
|
+
log "Finished batch ##{index}."
|
115
117
|
end
|
116
118
|
end
|
117
119
|
log_without_newline "\n"
|
@@ -121,8 +123,6 @@ module CounterCulture
|
|
121
123
|
private
|
122
124
|
|
123
125
|
def update_count_for_batch(column_name, records)
|
124
|
-
log_without_newline "."
|
125
|
-
|
126
126
|
ActiveRecord::Base.transaction do
|
127
127
|
records.each do |record|
|
128
128
|
count = record.read_attribute('count') || 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: counter_culture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus von Koeller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: after_commit_action
|