Skip to content

Commit

Permalink
lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Oct 16, 2024
1 parent b6489aa commit 591f4ef
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions app/jobs/private_body_decrypt_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
class PrivateBodyDecryptJob < ApplicationJob
queue_as :default

def perform(*args)
def perform
extra_fields = Decidim::DecidimAwesome::ProposalExtraField.where(decrypted_private_body: nil).where.not(private_body: nil)
return unless extra_fields.any?

extra_fields = Decidim::DecidimAwesome::ProposalExtraField
.where(decrypted_private_body: nil)
.where.not(private_body: nil)
if extra_fields.any?
Rails.logger "Extra fields to update: #{extra_fields.size}"
count = 0
extra_fields.find_each do |extra_field|
extra_field.update(decrypted_private_body: extra_field.private_body.to_s)
count += 1 if extra_field.decrypted_private_body_previous_change.present?
end
Rails.logger "Extra fields updated: #{count}"
Rails.logger.info "Extra fields to update: #{extra_fields.size}"
count = 0
extra_fields.find_each do |extra_field|
extra_field.update(decrypted_private_body: extra_field.private_body.to_s)
count += 1 if extra_field.decrypted_private_body_previous_change.present?
end
Rails.logger.info "Extra fields updated: #{count}"
end
end

0 comments on commit 591f4ef

Please sign in to comment.