Because of mana being nil sometimes in the cards record, the demo_data_seeds where failing when sorting the cards for the decks with the following error
rake aborted!
ArgumentError: comparison of Array with Array failed
[...]/hearthstats/db/demo_data_seeds.rb:31:in `sort_by'
A better explanation of the reason is here, the short version being sort_by not being able to compare integers and nil.
The second commit let the seeds avoid duplicating records for the cards and the seasons.
If you prefer, I can make two separate PRs.
Because of mana being
nil
sometimes in the cards record, thedemo_data_seeds
where failing when sorting the cards for the decks with the following errorA better explanation of the reason is here, the short version being
sort_by
not being able to compare integers andnil
.The second commit let the seeds avoid duplicating records for the cards and the seasons. If you prefer, I can make two separate PRs.