Hi Folks,
I'm looking for an elegant Ruby one-liner...

I have a set of records in my database that I want to check to see if
the :description field is identical.

And, because it's Thursday morning (where I live), I would like to do
it as elegantly and as one-line-er-ly as I can

Something like...

records.map(&:description).all?(&:==)

which, doesn't work

I'll go ahead and split it into a couple of lines, and make sure that
all of the descriptions match record[0].descriptions, but I am certain
there is a more elegant solution than this.

--wpd

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to