[ActiveRecord] Feature suggestion - PostgresSQL::OID::Interval

Hi all

I’ve been dealing with Postgres’ interval fields for a while and I find it super handy. One limitation I see when working with intervals in ActiveRecord though is that it handles intervals with OID::SpecializedString.

I would like to gauge the interest in casting intervals to instances of ActiveSupport::Duration instead of strings, and the introduction of a new OID::Interval to do that.

Please let me know what you think.

Thanks,

Jonas

1 Like

Hi @jmeinerz, there is a PR pending for that specific feature here: https://github.com/rails/rails/pull/16919. What would be needed is a core member to review it, because I think it would be a really useful feature.

Hi Louis. Thanks for pointing that out. I actually saw that PR but I thought it had gone stale. I guess I should have commented this there.

Thanks again, have a great day!