summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-10 15:16:13 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-10 15:18:54 +0200
commitd9696a5eb4aa8638b757ca95b4cc2a4d5b8ae4f6 (patch)
tree94859f172dbc3ecf831d13aab9263696793df122 /lib
parent2b664060f45efd7329b53f87f83cc764a5a53bdb (diff)
downloadnorsk-urskog-registrations-d9696a5eb4aa8638b757ca95b4cc2a4d5b8ae4f6.tar.gz
norsk-urskog-registrations-d9696a5eb4aa8638b757ca95b4cc2a4d5b8ae4f6.tar.bz2
norsk-urskog-registrations-d9696a5eb4aa8638b757ca95b4cc2a4d5b8ae4f6.zip
Reject bands with no name
Diffstat (limited to 'lib')
-rw-r--r--lib/band.rb4
1 files changed, 4 insertions, 0 deletions
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