From dce607a72ecc2cc5415ee025452173dc927e1b94 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 10 Oct 2015 14:24:55 +0200 Subject: Fix init of empty band. --- lib/band.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/band.rb') diff --git a/lib/band.rb b/lib/band.rb index 61efcee..760274b 100644 --- a/lib/band.rb +++ b/lib/band.rb @@ -8,6 +8,9 @@ class Band def initialize(params = nil) @errors = [] + @contact = Contact.new + @members = [] + @songs = [] if params @name = params['name'] @@ -18,14 +21,12 @@ class Band @contact = Contact.new(params['contact']) - @members = [] if params['members'] params['members'].each do |k, m| @members << Member.new(m) end end - @songs = [] if params['songs'] params['songs'].each do |k, s| @songs << Song.new(s) -- cgit v1.2.3