I don't have time to dig into why this is happening, since there's an obvious 
workaround, but can anyone quickly tell me why:

>> p.file_record.financial_report_lines.sum('royalty_usd_price').to_f
=> 0.0

but

>> p.file_record.financial_report_lines.map(&:royalty_usd_price).inject(&:+).to_f
=> 297.08

(here, royalty_usd_price is a decimal in MySQL).

Regards,

Guyren G Howe
Relevant Logic LLC

guyren-at-relevantlogic.com ~ http://relevantlogic.com ~ +1 512 784 3178

Ruby/Rails,  REALbasic, PHP programming
PostgreSQL, MySQL database design and consulting
Technical writing and training

Read my book, Real OOP with REALbasic: 
<http://relevantlogic.com/oop-book/about-the-oop-book.php>

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to