Using active_support to get second, third

Great post here about how to get second and third using Active Support. i.e. use

require ‘active_support/core_ext’

The moral of the tale though is that using an indexer (i.e. people[2] instead of people.third) is probably preferable apart from cases like people.first (which comes with Array anyway).

Leave a Reply

Your email address will not be published. Required fields are marked *