diff --git a/app/jobs/cache_attribute_word_count_job.rb b/app/jobs/cache_attribute_word_count_job.rb index fb3336e33..80caa5ad1 100644 --- a/app/jobs/cache_attribute_word_count_job.rb +++ b/app/jobs/cache_attribute_word_count_job.rb @@ -7,7 +7,7 @@ def perform(*args) # If we have a blank/null value, ezpz 0 words if attribute.nil? || attribute.value.nil? || attribute.value.blank? - attribute.update!(word_count_cache: 0) + attribute.update_column(:word_count_cache, 0) return end @@ -29,6 +29,6 @@ def perform(*args) stray_punctuation: 'ignore' ).count(attribute.value) - attribute.update!(word_count_cache: word_count) + attribute.update_column(:word_count_cache, word_count) end end diff --git a/lib/tasks/cache.rake b/lib/tasks/cache.rake index 54ae02bb5..1b06f1f06 100644 --- a/lib/tasks/cache.rake +++ b/lib/tasks/cache.rake @@ -58,7 +58,7 @@ namespace :cache do content_type.order('updated_at DESC').find_each do |entity| sum_attribute_word_count = Attribute.where(entity_type: content_type.name, entity_id: entity.id).sum(:word_count_cache) - entity.update(cached_word_count: sum_attribute_word_count) + entity.update_column(:cached_word_count, sum_attribute_word_count) end end end