You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
where: ranges: exclusive ranges are treated as inclusive, and endless/beginless ranges raise RangeError #400
whenRange"#{quoted_key} >= #{quote_value(value.first)} AND #{quoted_key} <= #{quote_value(value.last)}"
This has two problems:
exclude_end? is ignored, so a...b also matches b.
Range#first / Range#last raise on beginless and endless ranges, so idiomatic Ruby like date: (Date.new(2026, 1, 1)..) crashes before any request is made.
Steps to reproduce
XeroRuby::Where.new(amount_due: (100...200)).to_param# => "AmountDue >= 100 AND AmountDue <= 200"XeroRuby::Where.new(date: (Date.new(2026,1,1)...Date.new(2026,2,1))).to_param# => "Date >= DateTime(2026,01,01) AND Date <= DateTime(2026,02,01)"XeroRuby::Where.new(date: (Date.new(2026,1,1)..)).to_param# => RangeError: cannot get the last element of endless range
Expected
AmountDue >= 100 AND AmountDue < 200
Date >= DateTime(2026,01,01) AND Date < DateTime(2026,02,01)
Date >= DateTime(2026,01,01)
Activity