How about to add support for interval datatype in rails? There is ActiveSupport:Duration class, that allows to use magic like 10.hours
I want to do something like:
create_table :events do |t|
Event.create(name: ‘Greatest event’, duration: 5.hours + 30.minutes)
Event.last.duration # => 19800
Event.last.duration.inspect # => “330 minutes and 0 seconds”
I’ve done some working (at first glance) initializer for Rails 4.1 here: https://gist.github.com/Envek/7077bfc36b17233f60ad
So, if Core Team agree I’ll be happy to make pull request for current master with this stuff (with tests and all input|output formats from documentation: http://www.postgresql.org/docs/9.4/static/datatype-datetime.html#DATATYPE-INTERVAL-INPUT ).
But I don’t sure about ActiveSupport::Duration. It’s weird and magic thing I’m afraid of.