Hello fellow Sequel fans.  Using the newest Sequel 4.10.0, I'm getting a 
very unlikely error when Sequel tries to convert an incoming BigDecimal to 
a string.

The error is "ArgumentError: wrong number of arguments (1 for 0)"

FILE:
/usr/lib/ruby/gems/2.1.0/gems/sequel-4.10.0/lib/sequel/dataset/sql.rb

FUNCTION:
    def literal_big_decimal(v)
      d = v.to_s("F")   #  <-- there

Thing is, it should work, according to 
http://www.ruby-doc.org/stdlib-2.1.1/libdoc/bigdecimal/rdoc/BigDecimal.html#method-i-to_s

I can't find any reason why it's giving a "ArgumentError: wrong number of 
arguments (1 for 0)" error.

When I comment out the ("F"), it works without error.

When I inspect the incoming "v" variable:
v.class is BigDecimal
v.inspect is #<BigDecimal:2df2da0,'0.1111E2',18(18)>
v to_s is 11.11

Any suggestions?

FWIW I'm using PostgreSQL database, and this value is stored as numeric 
type.

Thank you.

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to