franzejr / best-ruby

Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
http://franzejr.github.io/best-ruby/
2.39k stars 219 forks source link

best-ruby/idiomatic_ruby/each_vs_map.md #50

Closed taw closed 8 years ago

taw commented 8 years ago

This code:

users_ids = users.map &:id

Is anything but idiomatic. Something like this:

users_ids = users.map(&:id)

would look like proper Ruby.

Freely floating &: just looks weird.

franzejr commented 8 years ago

I agree. Could you submit a PR?

revdan commented 8 years ago

If we're talking about idiomatic English it should probably also be user_ids

franzejr commented 8 years ago

Hm...yeah, @revdan. I think it should be better user_ids, you are right. Do you want to fix this ?

MarcosX commented 8 years ago

Since it was fixed on #52, we can close this, right?

franzejr commented 8 years ago

Right! :+1: