When adding an extra_validator, we may need to rely on some other values from the current collection. We could add it as an extra param in the validator
class NameOrCompanyValidator < Csv2hash::ExtraValidator
def valid? rule, value, collection
value.present? || collection['company'].present?
end
end