1
0
Fork 0
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:
David Heinemeier Hansson 2017-07-04 14:54:38 +02:00
parent d7e877be24
commit a146858a14

View file

@ -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