Ruby on Rails
Tuesday, January 3, 2012
Hello all, I've recently been on a project where somewhere needs
using case insensitive search(using UPPER(name) LIKE '') and LIKE condition,
I want to use arel and don't use the old style string concatenation,
can arel handle this?
But I check on arel documentation, doesn't seems have any upper/like operator,
and check on arel source, under lib/arel/nodes,
doesn't seem to have any node related to this,
can arel handl this?
Thanks.
ps, the arel way of binding value seems to have its own invocation,
using eq(xxx),
accounts = Account.arel_table
Account.where(accounts[:id].eq(1).or(accounts[:id].eq(2))) different from where rails old style binding, like where(:conditions=>[UPPER(name) like ?, '%#{xxx}%]],
so How can I bind them two?
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment