module ActiveSupport::MessagePack::Extensions

def read_duration(unpacker)

def read_duration(unpacker)
  value = unpacker.read
  parts = ActiveSupport::Duration::PARTS.zip(unpacker.read).to_h
  parts.compact!
  ActiveSupport::Duration.new(value, parts)
end