Story#119627029 - extract checksum calculator

(cherry picked from commit c90c985)
This commit is contained in:
Vladimir Krylov 2016-06-30 11:57:16 +03:00
parent 2e4e07503f
commit ca74eaeca1
2 changed files with 8 additions and 4 deletions

View file

@ -55,6 +55,12 @@ class LegalDocument < ActiveRecord::Base
end
end
def calc_checksum
digest = Digest::SHA1.new
digest.update File.binread(path)
digest.to_s
end
def add_creator
self.creator_str = ::PaperTrail.whodunnit
true