Skip to content

Commit

Permalink
Delegate pluralization to I18n
Browse files Browse the repository at this point in the history
  • Loading branch information
izzergh committed Mar 31, 2020
1 parent 98be0a5 commit a6fa54a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/acts_as_span/no_overlap_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a6fa54a

Please sign in to comment.