You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Schedule generation is quite independent of the model itself it is way too much logic in the models class and should be extracted into a PlainOldRubyObject(PORO), that handles all the edge cases and encapsulates how the schedule specifically is generated.
Tests for this should also be extracted from league_spec.rb and could potentially use moc-objects for the event objects, to speed things up a little bit if needed.
What this accomplishes:
Encapsulates algorithms into their own file and classes so that you don't have to search the huge model file for the correct lines if you want to change anything
Decouples the algorithms from the League class so that in theory you can use them with other events aswell
Improves readability, by allowing more names and more submethods without cluttering the model
The text was updated successfully, but these errors were encountered:
Since Schedule generation is quite independent of the model itself it is way too much logic in the models class and should be extracted into a PlainOldRubyObject(PORO), that handles all the edge cases and encapsulates how the schedule specifically is generated.
Tests for this should also be extracted from
league_spec.rb
and could potentially use moc-objects for the event objects, to speed things up a little bit if needed.What this accomplishes:
The text was updated successfully, but these errors were encountered: