There are a couple of datatypes that Postgres uses that don't come through 
Sequel unscathed ("uuid" and "array" to name two), but this one surprised me. 
"money" comes back as 0.0, no matter what actual amount is in the database.


CREATE TABLE tsttbls (
        tsttbl_id uuid DEFAULT uuid_generate_v1() NOT NULL,
        note varchar,
        fee money,
        PRIMARY KEY (tsttbl_id)
);

insert into tsttbls(note, fee) values('Lunch', '23.50'::money);
insert into tsttbls(note, fee) values('Taxicab', '35.00'::money);

>> class Tsttbl < Sequel::Model end
>> t = Tsttbl.first
>> puts "#{t.note}\t #{t.fee}"
Lunch    0.0

>> pp Tsttbl.select(:fee).all

[#<Tsttbl @values={:fee=>#<BigDecimal:10201fce0,'0.0',4(4)>}>,
 #<Tsttbl @values={:fee=>#<BigDecimal:10201fa10,'0.0',4(4)>}>]

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to