When retrieving a decimal value from a table, it throws NoMethodError (undefined methodnew' for BigDecimal:Class)`
The field is defined as a decimal(10, 4)
Simplest Possible Self-Contained Example Showing the Bug
2.7.0 :014 > DB[:mytable].where(id: 2).select(:amount).first
Traceback (most recent call last):
16: from /home/jrgns/myproject/Rakefile:67:in `block (3 levels) in <top (required)>'
15: from (irb):13
14: from (irb):14:in `rescue in irb_binding'
13: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:208:in `first'
12: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:693:in `single_record'
11: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:705:in `single_record!'
10: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:950:in `with_sql_first'
9: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:942:in `with_sql_each'
8: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/adapters/tinytds.rb:214:in `fetch_rows'
7: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/dataset/actions.rb:1089:in `execute'
6: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/adapters/tinytds.rb:46:in `execute'
5: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/database/connecting.rb:270:in `synchronize'
4: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/connection_pool/sharded_threaded.rb:130:in `hold'
3: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/adapters/tinytds.rb:77:in `block in execute'
2: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/adapters/tinytds.rb:238:in `block in fetch_rows'
1: from /home/jrgns/myproject/vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/lib/sequel/adapters/tinytds.rb:238:in `each'
NoMethodError (undefined method `new' for BigDecimal:Class)
Casting it to a string returns the value (as a string)
Complete Description of Issue
When retrieving a decimal value from a table, it throws
NoMethodError (undefined method
new' for BigDecimal:Class)`The field is defined as a decimal(10, 4)
Simplest Possible Self-Contained Example Showing the Bug
Casting it to a string returns the value (as a string)
Ruby 2.7 Sequel 5.29.0 MSSQL 2014