Hello have a question about the pg_interval extension.
Ran into issue when testing month records.

STEPS:
1) Create ActiveSupport::Duration `ActiveSupport::Duration.parse('P1M')`
This Duration has an internal value of 2629746
Same as constant SECONDS_PER_MONTH 
https://api.rubyonrails.org/v6.0.3.4/classes/ActiveSupport/Duration.html

2) Value saved to db with pg_interval extension

3) Value retried from db with pg_interval extension 
The returned value has the correct parts [[:months, 1]] but the internal 
value is 2592000
As set in pg_interval.rb 
line 78 `value += 2592000 * v`
line 107 `ActiveSupport::Duration.new(value, parts)`

This causes initial ActiveSupport::Duration to not be equal to returned 
ActiveSupport::Duration

Is there something I may be doing incorrect or is this a valid issue?
Would updating version of Activesupport or sequel help? From quick look at 
docs/code seems like may run into same issue?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/83788805-dac6-4ae8-8523-c581cd039158n%40googlegroups.com.

Reply via email to