mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Extract explaining method
This commit is contained in:
parent
d7e877be24
commit
a146858a14
1 changed files with 5 additions and 1 deletions
|
@ -32,7 +32,7 @@ class ActiveFile::Sites::GCSSite < ActiveFile::Site
|
|||
end
|
||||
|
||||
def checksum(key)
|
||||
file_for(key).md5.unpack("m0").first.unpack("H*").first
|
||||
convert_to_hex base64: file_for(key).md5
|
||||
end
|
||||
|
||||
|
||||
|
@ -40,4 +40,8 @@ class ActiveFile::Sites::GCSSite < ActiveFile::Site
|
|||
def file_for(key)
|
||||
bucket.file(key)
|
||||
end
|
||||
|
||||
def convert_to_hex(base64:)
|
||||
base64.unpack("m0").first.unpack("H*").first
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue