In Ruby on Rails I have a collection of data which needs to be filtered to get the most recently created ones of each month. What is the best optimized way to do this?
e.g
["2012-1-2","2012-1-18", "2012-1-5", "2012-2-15","2012-2-23","2012-2-4"]
result should be
["2012-1-18, "2012-2-23", ..]
Returns dates objects.
Transform to strings again 🙂