Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tod support #162

Open
jaysson opened this issue Feb 22, 2018 · 0 comments
Open

tod support #162

jaysson opened this issue Feb 22, 2018 · 0 comments

Comments

@jaysson
Copy link

jaysson commented Feb 22, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants