Using interval in PostgreSQL with Ruby on Rails

后端 未结 2 774
孤城傲影
孤城傲影 2021-02-14 16:47

I want to save durations (2 days, 5 years, ...) as intervals in PostgreSQL from my Rails application.

Both duration_min and duration_max are values like \"2 days\" or \"

2条回答
  •  我寻月下人不归
    2021-02-14 17:20

    We have an implementation of interval for Rails 5.1 that you can try.

    https://gist.github.com/vollnhals/a7d2ce1c077ae2289056afdf7bba094a

提交回复
热议问题