From d9696a5eb4aa8638b757ca95b4cc2a4d5b8ae4f6 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 10 Oct 2015 15:16:13 +0200 Subject: Reject bands with no name --- lib/band.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/band.rb b/lib/band.rb index e75dd6e..59e7541 100644 --- a/lib/band.rb +++ b/lib/band.rb @@ -41,6 +41,10 @@ class Band end def validate! + if @name.nil? || @name.strip.empty? + errors << "Bandnavn mangler" + end + if @songs.length <= 0 errors << "Du må ha med minst én låt!" end -- cgit v1.2.3