mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Story#119627029 - extract checksum calculator
(cherry picked from commit c90c985
)
This commit is contained in:
parent
2e4e07503f
commit
ca74eaeca1
2 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue