From a6fa54a651fc8e85dbd7731cc002e89fa7ec210f Mon Sep 17 00:00:00 2001 From: is Date: Tue, 31 Mar 2020 16:34:56 -0400 Subject: [PATCH] Delegate pluralization to I18n --- lib/acts_as_span/no_overlap_validator.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/acts_as_span/no_overlap_validator.rb b/lib/acts_as_span/no_overlap_validator.rb index d1c2219..5657984 100644 --- a/lib/acts_as_span/no_overlap_validator.rb +++ b/lib/acts_as_span/no_overlap_validator.rb @@ -12,15 +12,9 @@ def validate(record) if overlapping_records.any? && instance_scope - error_type = if overlapping_records.size == 1 - "no_overlap.one" - else - "no_overlap.other" - end - record.errors.add( :base, - error_type.to_sym, + :no_overlap, model_name: record.class.model_name.human, model_name_plural: record.class.model_name.plural.humanize, start_date: record.span.start_date,