discourse/app/models/do_not_disturb_timing.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
262 B
Ruby
Raw Normal View History

2020-12-18 10:03:51 -05:00
# frozen_string_literal: true
class DoNotDisturbTiming < ActiveRecord::Base
belongs_to :user
validate :ends_at_greater_thans_starts_at
def ends_at_greater_thans_starts_at
if starts_at > ends_at
errors.add(:ends_at, :invalid)
end
end
end