lib/lite/validators/csv_validator.rb in lite-validators-1.0.6 vs lib/lite/validators/csv_validator.rb in lite-validators-1.0.7
- old
+ new
@@ -17,19 +17,19 @@
record.errors.add(attribute, *error_message)
end
private
- # rubocop:disable Metrics/LineLength, Style/GuardClause
+ # rubocop:disable Layout/LineLength, Style/GuardClause
def assert_valid_dimensions!
if dimensions.empty?
raise ArgumentError, "Missing atleast one dimension of #{DIMENSIONS.map(&:inspect).join(', ')} attribute for comparison."
else
assert_valid_option!(:dimensions, DIMENSIONS)
end
end
- # rubocop:enable Metrics/LineLength, Style/GuardClause
+ # rubocop:enable Layout/LineLength, Style/GuardClause
def csv_dimensions(path)
dimension = { columns: 0, rows: 0 }
CSV.foreach(path) do |row|
@@ -50,10 +50,10 @@
end
def error_message_for(dimension, check, check_value)
options[:message] || I18n.t(
"errors.messages.csv.#{check}",
- error_options(check_value).merge(dimension: dimension)
+ **error_options(check_value).merge(dimension: dimension)
)
end
def valid_attr?
options.slice(*DIMENSIONS).each do |dimension, dimension_value|