validates_timeliness icon indicating copy to clipboard operation
validates_timeliness copied to clipboard

tod support

Open jaysson opened this issue 7 years ago • 0 comments

When I serialize the time field using https://github.com/jackc/tod, I get "not a valid time" error from validates_timeliness.

# my_model.rb
class MyModel  < ApplicationRecord
  validates_time :closes_at, after: :opens_at
  serialize :opens_at, Tod::TimeOfDay
  serialize :closes_at, Tod::TimeOfDay
end
MyModel.where(opens_at: "10:30", closes_at: "14:30").first_or_create
# Closes at is not a valid time

jaysson avatar Feb 22 '18 18:02 jaysson