On Thu, Mar 17, 2011 at 01:05:42PM -0400, J Smith wrote: > On Thu, Mar 17, 2011 at 5:52 AM, Ernie Miller <[email protected]> wrote: > > > > The Arel.sql factory method already enables the easy creation of > > SqlLiterals without monkeypatching String. Seems to me that this > > method doesn't really give us anything much more convenient than that, > > for the times when this sort of thing is needed. > > > > How would I use Arel.sql relative to the example from earlier, i.e. > from the ActiveRecord attributes standpoint? This still seems to be > escaped, for instance: > > MyModel.create(:field => Arel.sql('now()'))
This is a bug. You should be able to pass strings tagged using Arel.sql() in and have them remain untouched. Do you mind filing a ticket in lighthouse and assigning it to me? Or even better, come up with a patch that fixes it? ;-) -- Aaron Patterson http://tenderlovemaking.com/
pgpG397oq72kO.pgp
Description: PGP signature
