This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
|
class AtLeastOneValidator < ActiveModel::EachValidator
|
|
|
|
def validate_each(record, attribute, value)
|
|
record.errors[attribute] << (options[:message] || I18n.t("errors.at_least_one")) if (value.blank? || value.values.join.eql?(''))
|
|
end
|
|
|
|
end |