Skip to content

Commit

Permalink
Merge pull request #357 from internetee/registry-316
Browse files Browse the repository at this point in the history
Redirect debug messages from STDOUT to default logger
  • Loading branch information
vohmar committed Jan 25, 2017
2 parents 01d7c1a + 8470891 commit 3638544
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/legal_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add_creator

def self.remove_duplicates
start = Time.zone.now.to_f
puts '-----> Removing legal documents duplicates'
Rails.logger.info '-----> Removing legal documents duplicates'
count = 0
modified = Array.new

Expand All @@ -80,7 +80,7 @@ def self.remove_duplicates
File.delete(new_legal.path) if File.exist?(new_legal.path)
new_legal.update(path: orig_legal.path)
count += 1
puts "File #{new_legal.path} has been removed by Domain #{new_legal.documentable_id}. Document id: #{new_legal.id}"
Rails.logger.info "File #{new_legal.path} has been removed by Domain #{new_legal.documentable_id}. Document id: #{new_legal.id}"
end
end

Expand All @@ -104,11 +104,11 @@ def self.remove_duplicates
File.delete(new_legal.path) if File.exist?(new_legal.path)
new_legal.update(path: orig_legal.path)
count += 1
puts "File #{new_legal.path} has been removed by Contact #{new_legal.documentable_id}. Document id: #{new_legal.id}"
Rails.logger.info "File #{new_legal.path} has been removed by Contact #{new_legal.documentable_id}. Document id: #{new_legal.id}"
end
end
end
puts "-----> Duplicates fixed for #{count} rows in #{(Time.zone.now.to_f - start).round(2)} seconds"
Rails.logger.info "-----> Duplicates fixed for #{count} rows in #{(Time.zone.now.to_f - start).round(2)} seconds"

end
end

0 comments on commit 3638544

Please sign in to comment.