-
- Downloads
Clean up ActiveRecord code in TodosFinder
This refactors the TodosFinder finder according to the new code reuse rules, as enforced by the CodeReuse cops. I also changed some of the methods to use regular if statements, instead of assignments and/or early returns. This results in a more natural flow when reading the code, and it makes it harder to accidentally return the wrong result.
parent
c616327c
No related branches found
No related tags found
Showing
- app/finders/todos_finder.rb 33 additions, 53 deletionsapp/finders/todos_finder.rb
- app/models/project.rb 8 additions, 0 deletionsapp/models/project.rb
- app/models/todo.rb 19 additions, 0 deletionsapp/models/todo.rb
- spec/finders/todos_finder_spec.rb 0 additions, 1 deletionspec/finders/todos_finder_spec.rb
- spec/models/project_spec.rb 23 additions, 0 deletionsspec/models/project_spec.rb
- spec/models/todo_spec.rb 69 additions, 0 deletionsspec/models/todo_spec.rb
Please register or sign in to comment