def normalize_inputs!(inputs)
      return inputs if inputs.is_a?(Hash)

      parameters = 'ActionController::Parameters'
      klass = parameters.safe_constantize
      return inputs.to_unsafe_h if klass && inputs.is_a?(klass)

      raise ArgumentError, "inputs must be a hash or #{parameters}"
    end
def normalize_inputs!(inputs)
      return inputs if inputs.is_a?(Hash)

      parameters = 'ActionController::Parameters'
      klass = parameters.safe_constantize
      return inputs.to_unsafe_h if klass && inputs.is_a?(klass)

      raise ArgumentError, "inputs must be a hash or #{parameters}"
    end
We want to allow both `Hash` objects and `ActionController::Parameters`
 objects. In Rails < 5, parameters are a subclass of hash and calling
 `#symbolize_keys` returns the entire hash, not just permitted values. In
 Rails >= 5, parameters are not a subclass of hash but calling
 `#to_unsafe_h` returns the entire hash.