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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 777802252a7bcb024846dbf377b2914567ab94e5bea74889b910fa7adcbdc5a6
4
- data.tar.gz: '09238bd80b3ec7df9573ae591f44a4f4c01eb408acf279f84fd1c642317f0593'
3
+ metadata.gz: d29aaa4f5707919469b563c27c2d78b3f188d9aa4b064e1fb6590546095ee951
4
+ data.tar.gz: 683692c14e1ac6b37ed31f9d18f911bf517e859630aebdbd352ae69fa552f63a
5
5
  SHA512:
6
- metadata.gz: 75c18349057e37e2de194b8d58583d430ee23c161d3f33ae69ab2b12d8237c21940526e2b1de1ee869704ea55a5ebca710b6aeaa4528d33b1f9c113eacef30c6
7
- data.tar.gz: adb4fee3d7c03874b5d484a086a184a65e25d535281841bc111117c2b56993c0217a5881103cc877ddb7b5e9bba8d8c8a8c0932b92e36586ef472e933d3fb6db
6
+ metadata.gz: b4316fd30adc6c1ea052f9962e1c40baf4806b5cb016fab75e6cd202add290a495dfc8d83573e47d663032fc5d4b1f193d7b6b5cd211c7cce98802c6528fea2d
7
+ data.tar.gz: ec4573685944d69be763bbb9237029ff2c18fe657930e9dccd4c26036b1662b938c55bc69fc59bd1adb6b7f1430c8381c94ceaa730fac8c1e7bf3786a252a1c4
@@ -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.public_send("#{key}=", old_value)
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
@@ -1,3 +1,3 @@
1
1
  module CounterCulture
2
- VERSION = '2.5.1'.freeze
2
+ VERSION = '2.6.0'.freeze
3
3
  end
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.5.1
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-05-18 00:00:00.000000000 Z
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