class StrongerParameters::FileConstraint

Constants

VALID_FILE_TYPES

Public Instance Methods

value(v) click to toggle source
# File lib/stronger_parameters/constraints/file_constraint.rb, line 13
def value(v)
  if VALID_FILE_TYPES.any? { |valid_file_type| v.is_a?(valid_file_type) }
    return v
  end

  InvalidValue.new(v, "must be an file object")
end