# Problema para asignar un array a un modelo

He tenido que implementar un algoritmo Round-Robin para crear el
calendario de jornadas de mi aplicaciÃ³n (el algoritmo es correcto), pero
tengo problemas para asignar los resultados a mis modelos, pego aquÃ­ el
cÃ³digo:

def create_rounds
rounds = make_rounds(self.clubs)
self.rounds = rounds
end

def make_rounds(clubs)
#If odd insert dummy club
if clubs.length % 2 == 1
clubs << :dummy
end

rounds_home = []
rounds_away = []
num_rounds = clubs.length - 1
num_matches = clubs.length / 2 - 1

for i in (1…num_rounds)
matches_home = []
matches_away = []
for j in (0…num_matches)
matches_home << MatchGeneral.new({
:local => clubs[j],
:guest => clubs[num_rounds - j]
}) #Home match
matches_away << MatchGeneral.new({
:local => clubs[num_rounds - j],
:guest => clubs[j]
})
end
rounds_home << Round.new({
:round_number => i,
:match_generals => matches_home
})
rounds_away << Round.new({
:round_number => num_rounds + i,
:match_generals => matches_away})
#rotating the teams
last = clubs.pop
clubs.insert(1, last)
end

rounds_away.each { |x| rounds_home << x}
return rounds_home
end

El error que recibo al ejecutar el mÃ©todo create_rounds es este:

undefined method `local_before_type_cast’ for #MatchGeneral:0xb71d0a08