Closed maniacmansion closed 10 years ago
the two requirements say the same?! No Go has only a meaning if a customer wants that genre? Is there a difference between "Don't have it" and "No Go"?
No, just want to make sure...You got it.
I added an exclude_flag which is set true if an DJ has a NoGo for a demanded kind of music. Because of it's complexity I made a lib file from that piece of code ( _matchscore.rb ).
Have a look in the test case _spec/calc_match_scorespec.rb. Test with:
rspec -Ilib spec/calc_match_score_spec.rb
To play with test data I created a script ( _script/create_test_data/create_testdata.sh ) that build a sqlite3 db ( _testdata.sqlite3 ) from SQL-Text-Files in the directory _script/create_testdata. Use the script with:
script/create_test_data/create_test_data.s
mv script/create_test_data/test_data.sqlite3 spec/test_data/
Then I re-factored the main app to use the lib. To make the use of the lib classes more convenient I included my namespace (module DiscJockey in the lib files) into the main class (line 14 of _disc_jockeycontroller.rb ).
When a customer wants a genre and a DJ has a 'no go' for that particular genre he will be ignored on the matching.
If a DJ uses a 'no go' this will be a show stopper!