lib/gdshowsdb/models/song.rb in gdshowsdb-1.0.0 vs lib/gdshowsdb/models/song.rb in gdshowsdb-1.0.1
- old
+ new
@@ -12,9 +12,10 @@
Song.find_by_uuid(spec[:uuid])
end
def self.create_song_relationships(spec)
song_ref = SongRef.find_by_name(spec[:name])
+ raise "Unable to find a song ref named #{spec[:name]} #{spec.inspect}" unless song_ref
song_ref.songs << Song.find_by_uuid(spec[:uuid])
song_ref.song_occurences << SongOccurence.create_from(uuid: SecureRandom.uuid, position: spec[:position], show_set_uuid: spec[:show_set_uuid])
song_ref.save
end
\ No newline at end of file