こんにちは、sort_by メソッド ブロックで一意のレコードを見つける方法について、これらのレコードを持っています
my array is like this
[#<Post id: 1, name: "ali", team_elo: 0, team_name: "solo", created_at:
"2012-12-09 16:11:17", updated_at: "2012-12-11 03:39:43">,
#<Post id: 2, name: "ramiz", team_elo: nil, team_name: "roko", created_at:
"2012-12-11 03:40:31", updated_at: "2012-12-11 03:40:31">,
#<Post id: 3, name: "ramizrt", team_elo: nil, team_name: "joko", created_at:
"2012-12-11 03:40:47", updated_at: "2012-12-11 03:40:47">,
#<Post id: 4, name: "lee", team_elo: nil, team_name: "roko", created_at:
"2012-12-11 03:41:15", updated_at: "2012-12-11 03:41:15">]
一意の team_name に基づいてこの配列をソートする方法.結果は次のようになります
[#<Post id: 1, name: "ali", team_elo: 0, team_name: "solo", created_at:
"2012-12-09 16:11:17", updated_at: "2012-12-11 03:39:43">,
#<Post id: 2, name: "ramiz", team_elo: nil, team_name: "roko", created_at:
"2012-12-11 03:40:31", updated_at: "2012-12-11 03:40:31">,
#<Post id: 3, name: "ramizrt", team_elo: nil, team_name: "joko", created_at:
"2012-12-11 03:40:47", updated_at: "2012-12-11 03:40:47">]
ありがとう