Instead of writing this
[sourcecode language='ruby']
Profile.find(:all).collect{ |x| x.email }
[/sourcecode]
I could write this using Rails’ Symbol#to_proc
[sourcecode language='ruby']
Profile.find(:all).collect(&:email)
[/sourcecode]
Nice.
Instead of writing this
[sourcecode language='ruby']
Profile.find(:all).collect{ |x| x.email }
[/sourcecode]
I could write this using Rails’ Symbol#to_proc
[sourcecode language='ruby']
Profile.find(:all).collect(&:email)
[/sourcecode]
Nice.