I\'m looking for the best way to use a duration field in a Rails model. I would like the format to be HH:MM:SS (ex: 01:30:23). The database in use is sqlite locally and Postgr
I've wrote a some stub to support and use PostgreSQL's interval type as ActiveRecord::Duration.
interval
ActiveRecord::Duration
See this gist (you can use it as initializer in Rails 4.1): https://gist.github.com/Envek/7077bfc36b17233f60ad
Also I've opened pull requests to the Rails there: https://github.com/rails/rails/pull/16919