• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sleede / fab-manager / #106

pending completion
#106

push

coveralls-ruby

sylvainbx
Merge branch 'dev' for release 6.0.0

704 of 704 new or added lines in 168 files covered. (100.0%)

7919 of 13474 relevant lines covered (58.77%)

15.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/app/validators/date_range_validator.rb
1
# frozen_string_literal: true
2

3
# Validates that start_at is same or before end_at in the given record
4
class DateRangeValidator < ActiveModel::Validator
1✔
5
  def validate(record)
1✔
6
    the_end = record.end_at
4✔
7
    the_start = record.start_at
4✔
8
    return if the_end.present? && the_end >= the_start
4✔
9

10
    record.errors.add(:end_at, I18n.t('errors.messages.end_before_start', **{ START: the_start }))
×
11
  end
12
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc