This project is archived and is in readonly mode.
ActiveRecord casts everything to a string when Arel select is used.
Reported by Samuel Danielson | February 25th, 2010 @ 02:59 PM
I can reproduce this behavior with both sqlite and postgresql in rails 3.0.0.beta1.
>> AnyModel.select('1.0 as t').first.t
=> "1.0"
>> AnyModel.select('1 as t').first.t
=> "1"
Comments and changes to this ticket
-
Xavier Noria February 26th, 2010 @ 02:57 PM
I don't think there's a way to infer the type, since there's no SQL parsing going on. Same happens in 2.3, same reason.
-
José Valim March 12th, 2010 @ 06:37 PM
- State changed from new to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>