diff options
Diffstat (limited to 'lib/gitlab/database/sha_attribute.rb')
-rw-r--r-- | lib/gitlab/database/sha_attribute.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/database/sha_attribute.rb b/lib/gitlab/database/sha_attribute.rb index 776e80701f1..bad6d3e2a9b 100644 --- a/lib/gitlab/database/sha_attribute.rb +++ b/lib/gitlab/database/sha_attribute.rb @@ -24,7 +24,14 @@ module Gitlab def serialize(value) arg = value ? [value].pack(PACK_FORMAT) : nil - super(arg) + BINARY_TYPE.new.serialize(arg) + end + + # Casts a SHA1 in hexadecimal to the proper binary format. + def self.serialize(value) + arg = value ? [value].pack(PACK_FORMAT) : nil + + BINARY_TYPE.new.serialize(arg) end end end |