module Hashid::Rails::ClassMethods
def hashid_decode(id, fallback:)
def hashid_decode(id, fallback:) fallback_value = fallback ? id : nil decoded_hashid = hashids.decode(id.to_s) if hashid_configuration.sign_hashids valid_hashid?(decoded_hashid) ? decoded_hashid.last : fallback_value else decoded_hashid.first || fallback_value end rescue Hashids::InputError fallback_value end