On 27 October 2010 11:43, Pale Horse <[email protected]> wrote: > Which of the two methods below are the most stable? Does it matter? > > [email protected]? > @articles.length > 0 > > I personally prefer using the 'empty?' method.
Between the two, I'd use ".empty?", but at a choice I'd use neither, and go for ".blank?" instead. ".blank?" can be a bit more "stable" as it returns true for nil values, as well as blank strings, empty arrays and hashes... -- 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.

