mercredi 3 juin 2015

I don't understand the flat_map function in ruby, how can I improve my method?

I don't understand the flat_map function in ruby, what is wrong with my method and how can I improve it? Thank you!

 reviews = Review.limit(30)
 reviews.flat_map do |review|
    review.stars.to_a
 end

Aucun commentaire:

Enregistrer un commentaire