Class: Spree::Notification

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spree/notification.rb

Overview

Notification class

Instance Method Summary collapse

Instance Method Details

#end_date_greater_than_start_dateObject



7
8
9
10
11
12
13
14
15
# File 'app/models/spree/notification.rb', line 7

def end_date_greater_than_start_date
  if start_date.blank?
    errors.add(:start_date, 'is required')
  elsif end_date.blank?
    errors.add(:end_date, 'is required')
  elsif end_date < start_date
    errors.add(:end_date, 'should be greater than start date')
  end
end