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()'))
That's really what I'm looking for, I guess -- a way to bypass quoting
and sanitization when I know that it's safe to do so, as with Ken
Collins' example with #limit and #order and the like and in my case
with attribute assignment. At least in the case of attribute
assignment that even SqlLiterals are escaped, unless I'm missing
something, which I may very well be.
Any ideas?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.