gitlab-org--gitlab-foss/app/services
Yorick Peterse 38b8ae641f
Clean up ActiveRecord code in TodoService
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.
2018-10-08 15:19:12 +02:00
..
application_settings Ask user explicitly about usage stats agreement 2018-09-07 14:32:28 +00:00
applications Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
auth Support multiple scopes when using authing container registry scopes 2018-08-01 13:03:16 +02:00
badges
boards Merge branch 'fix-rubocop-todo' into 'master' 2018-09-19 16:55:53 +00:00
chat_names Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
ci enqueue in process_build_service 2018-10-02 17:08:14 +02:00
clusters Do not persist errors from Kubernetes calls 2018-09-17 12:35:42 -05:00
commits Let Commits::TagService return a result hash 2018-08-10 16:45:11 +02:00
concerns Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
deploy_keys
deploy_tokens
discussions
emails Add ability to skip user email confirmation with API 2018-09-10 22:41:53 -07:00
events
files Adds chmod action to POST /projects/:id/repository/commits API 2018-09-27 11:51:15 +02:00
gpg_keys
groups Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
issuable Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
issues Move issue related_branches to service 2018-10-04 15:59:14 -03:00
keys
labels Added FromUnion to easily select from a UNION 2018-09-17 12:39:43 +02:00
lfs Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
mattermost
members
merge_requests Fix CE to EE merge (backport) 2018-10-05 17:39:42 +02:00
milestones Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
notes Auto resolve new notes of resolved discussions 2018-09-24 08:30:58 -05:00
projects Make GitLab pages support access control 2018-10-05 13:41:11 +00:00
prometheus
protected_branches Whitelist existing destroy_all offenses 2018-08-16 17:29:37 +02:00
protected_tags
quick_actions Add checks to InterpretService conditions 2018-10-03 13:51:08 +02:00
resource_events Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
search Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
tags Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
test_hooks
todos/destroy Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
users allow users api to set public_email 2018-10-01 13:24:16 +02:00
wiki_pages
wikis Replace whitespaces in wiki page attachments file names 2018-09-07 14:10:15 +00:00
access_token_validation_service.rb
after_branch_delete_service.rb
akismet_service.rb
audit_event_service.rb
base_count_service.rb
base_renderer.rb
base_service.rb
cohorts_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
compare_service.rb
create_branch_service.rb
create_deployment_service.rb
create_release_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
create_snippet_service.rb
delete_branch_service.rb
delete_merged_branches_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
event_create_service.rb
git_push_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
git_tag_push_service.rb Code cleaning in PostReceive services 2018-07-31 14:07:24 +00:00
gravatar_service.rb
ham_service.rb
import_export_clean_up_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
issuable_base_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
merge_request_metrics_service.rb
metrics_service.rb
note_summary.rb
notification_recipient_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
notification_service.rb Automatically disable Auto DevOps for project upon first pipeline failure 2018-09-06 19:20:42 +00:00
preview_markdown_service.rb render using RedCarpet if legacy_render parameter is set 2018-09-05 09:19:16 -05:00
push_event_payload_service.rb
repair_ldap_blocked_user_service.rb
repository_archive_clean_up_service.rb
reset_project_cache_service.rb
search_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
spam_check_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
spam_service.rb
submit_usage_ping_service.rb Ask user explicitly about usage stats agreement 2018-09-07 14:32:28 +00:00
system_hooks_service.rb
system_note_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
todo_service.rb Clean up ActiveRecord code in TodoService 2018-10-08 15:19:12 +02:00
update_release_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
update_snippet_service.rb
upload_service.rb
user_agent_detail_service.rb
user_project_access_changed_service.rb
validate_new_branch_service.rb
verify_pages_domain_service.rb
web_hook_service.rb