Michael Pavling wrote in post #958364:
> On 31 October 2010 20:05, MDM <[email protected]> wrote:
>> Both of these works which do you think is best.
>>   self.where('section LIKE ?', "%#{search_item}%")
>>   self.where('section LIKE ?', '%'+search_item+'%')
>
> personally, I prefer the syntax of the first method; it seems more
> "Ruby".

It also performs slightly better, since it doesn't create extra String 
objects.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 [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-talk?hl=en.

Reply via email to