Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveRecord casts everything to a string when Arel select is used.

#4054

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"

Reported by Samuel Danielson · February 25th, 2010 @ 02:59 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Xavier Noria
    Xavier Noria

    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.

    February 26th, 2010 @ 02:57 PM

  2. José Valim
    José Valim
    • State changed from new to invalid

    March 12th, 2010 @ 06:37 PM