I have this query:
p = Payment.where(:client_id => 1)
Then only some fields, so I execute this:
p.select(:id, :created_at, :amount)
The issue is that every amount in the result comes as BigDecimal, and it's not readable. I need to apply to_f
function inside rails console to have a readable set of results.
I tried map
,like this:
p.map {|p| p.amount.to_f}
But it returns to me an array only with the amounts, and I need it to be along with the other attributes.