class ParamsChecker::ParamChecker::FileChecker

Public Instance Methods

call() click to toggle source
# File lib/params_checker/param_checker.rb, line 313
def call
  return nil if schema[key][:allow_nil] && params[key].nil?

  check_type && params[key]
end
check_type() click to toggle source
# File lib/params_checker/param_checker.rb, line 319
def check_type
  valid = params[key].is_a?(ActionDispatch::Http::UploadedFile)
  add_field_error("This field's type must be file.") unless valid
  valid
end