38b8ae641f
This refactors the TodoService class according to our code reuse guidelines. The resulting code is a wee bit more verbose, but it allows us to decouple the column names from the input, resulting in fewer changes being necessary when we change the schema. One particular noteworthy line in TodoService is the following: todos_ids = todos.update_state(state) Technically this is a violation of the guidelines, because `update_state` is a class method, which services are not supposed to use (safe for a few allowed ones). I decided to keep this, since there is no alternative. `update_state` doesn't produce a relation so it doesn't belong in a Finder, and we can't move it to another Service either. As such I opted to just use the method directly. Cases like this may happen more frequently, at which point we should update our documentation with some sort of recommendation. For now, I want to refrain from doing so until we have a few more examples. |
||
---|---|---|
.. | ||
admin | ||
autocomplete | ||
concerns | ||
access_requests_finder_spec.rb | ||
awarded_emoji_finder_spec.rb | ||
branches_finder_spec.rb | ||
clusters_finder_spec.rb | ||
contributed_projects_finder_spec.rb | ||
environments_finder_spec.rb | ||
events_finder_spec.rb | ||
fork_projects_finder_spec.rb | ||
group_descendants_finder_spec.rb | ||
group_labels_finder_spec.rb | ||
group_members_finder_spec.rb | ||
group_projects_finder_spec.rb | ||
groups_finder_spec.rb | ||
issues_finder_spec.rb | ||
joined_groups_finder_spec.rb | ||
labels_finder_spec.rb | ||
license_template_finder_spec.rb | ||
members_finder_spec.rb | ||
merge_request_target_project_finder_spec.rb | ||
merge_requests_finder_spec.rb | ||
milestones_finder_spec.rb | ||
notes_finder_spec.rb | ||
pending_todos_finder_spec.rb | ||
personal_access_tokens_finder_spec.rb | ||
personal_projects_finder_spec.rb | ||
pipeline_schedules_finder_spec.rb | ||
pipelines_finder_spec.rb | ||
projects_finder_spec.rb | ||
runner_jobs_finder_spec.rb | ||
snippets_finder_spec.rb | ||
tags_finder_spec.rb | ||
template_finder_spec.rb | ||
todos_finder_spec.rb | ||
user_finder_spec.rb | ||
user_recent_events_finder_spec.rb | ||
users_finder_spec.rb | ||
users_with_pending_todos_finder_spec.rb |