Module: ActiveModel::Validations::HelperMethods

Defined in:
lib/validates_timeliness/helper_methods.rb

Instance Method Summary collapse

Instance Method Details

#validates_date(*attr_names) ⇒ Object



5
6
7
# File 'lib/validates_timeliness/helper_methods.rb', line 5

def validates_date(*attr_names)
  validates_with TimelinessValidator, _merge_attributes(attr_names).merge(type: :date)
end

#validates_datetime(*attr_names) ⇒ Object



13
14
15
# File 'lib/validates_timeliness/helper_methods.rb', line 13

def validates_datetime(*attr_names)
  validates_with TimelinessValidator, _merge_attributes(attr_names).merge(type: :datetime)
end

#validates_time(*attr_names) ⇒ Object



9
10
11
# File 'lib/validates_timeliness/helper_methods.rb', line 9

def validates_time(*attr_names)
  validates_with TimelinessValidator, _merge_attributes(attr_names).merge(type: :time)
end

#validates_timeliness_of(*attr_names) ⇒ Object



17
18
19
# File 'lib/validates_timeliness/helper_methods.rb', line 17

def validates_timeliness_of(*attr_names)
  validates_with TimelinessValidator, _merge_attributes(attr_names)
end