8 months ago
A Shorter `collect`

Instead of writing (for example)

Customers.find(:all).collect { |c| c.email }

you can also write

Customers.find(:all).collect(&:email)

I didn’t know that. Nice!

blog comments powered by Disqus