`1.week.days` is what you're looking for. I don't think an alias would be
necessarily bad, though. It's similarly done elsewhere.

On Thu, Mar 5, 2020 at 5:58 PM Jason York <jason.y...@gmail.com> wrote:

> Hi! Would it be valuable to add some convenience methods to Duration to
> convert the value to years, months, days?
>
> Ex:
>
> 1.week.to_days
> => 7
>
> 3.days.to_weeks
> => 0.429
>
> 40.hours.to_days
> => 1.67
>
> I wanted to check here before I work on a PR.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-core/5387f55e-341a-4b02-a24c-3e8d55f1c0ff%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-core/5387f55e-341a-4b02-a24c-3e8d55f1c0ff%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-core/CAHK71zfcEwcr%2BJxXqAE9fdam9j7vMK97AGPSvZNj8WX-t_%2BvqQ%40mail.gmail.com.

Reply via email to