lib/lite/validators/base_validator.rb in lite-validators-1.0.6 vs lib/lite/validators/base_validator.rb in lite-validators-1.0.7
- old
+ new
@@ -17,20 +17,20 @@
@record = record
@attribute = attribute
@value = value
end
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
def assert_valid_option!(name, collection, option: nil)
option ||= send(name)
[*option].each do |option_value|
next if collection.include?(option_value)
raise ArgumentError, "Unknown #{name}: #{option_value.inspect}. Valid options are: #{collection.map(&:inspect).join(', ')}"
end
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
def error_message
[options[:message] || :invalid]
end