I have the following model / table in rails3 / postgreSQL:
create_table "admin_reports", :force => true do |t| t.string "report" t.decimal "result" t.string "result_type" t.datetime "created_at" t.datetime "updated_at" end
In the process of creating AdminReports.result does not save the decimal, but rather the hash:
Adminminport.last
=> #<AdminReport id: 4, report: "dau", result: #<BigDecimal:cbca0f0,'0.8E1',4(8)>, result_type: "percentage", created_at: "2012-02-28 22:05:15", updated_at: "2012-02-28 22:05:15">
Where would I expect to see:
Adminminport.last
=> #<AdminReport id: 4, report: "dau", result: 10.10, result_type: "percentage", created_at: "2012-02-28 22:05:15", updated_at: "2012-02-28 22:05:15">
In the rails console, even if I try to set the result field manually like this:
@a = AdminReport.last @a.result = 8.89 @a.save
It still shows AdminReport.result as a BigDecimal hash. Any ideas what is going on here?
thanks
source share