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 Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
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 Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
deploy_tokens Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
discussions Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
emails Add ability to skip user email confirmation with API 2018-09-10 22:41:53 -07:00
events Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
files Adds chmod action to POST /projects/:id/repository/commits API 2018-09-27 11:51:15 +02:00
gpg_keys Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
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 Enable frozen string in apps/services/**/*.rb 2018-07-16 12:36:41 -07:00
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 Enable more frozen string in app/services/**/*.rb 2018-07-17 15:19:40 -07:00
members Delete todos when users loses target read permissions 2018-07-30 13:29:18 +02:00
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 Backports relevant changes made in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5163 to CE 2018-07-25 09:39:39 +01:00
protected_branches Whitelist existing destroy_all offenses 2018-08-16 17:29:37 +02:00
protected_tags Enable more frozen string in app/services/**/*.rb 2018-07-18 14:07:50 -07:00
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 Enable more frozen string in app/services/**/*.rb 2018-07-18 14:07:50 -07:00
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 Enable more frozen string in app/services/**/*.rb 2018-07-18 14:07:50 -07:00
wikis Replace whitespaces in wiki page attachments file names 2018-09-07 14:10:15 +00:00
access_token_validation_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
after_branch_delete_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
akismet_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
audit_event_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
base_count_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
base_renderer.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
base_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
cohorts_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
compare_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
create_branch_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
create_deployment_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
create_release_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
create_snippet_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
delete_branch_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
delete_merged_branches_service.rb Disable existing offenses for the CodeReuse cops 2018-09-11 17:32:00 +02:00
event_create_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
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 Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
ham_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
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 Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
metrics_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
note_summary.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
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 Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
repair_ldap_blocked_user_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
repository_archive_clean_up_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
reset_project_cache_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
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 Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
submit_usage_ping_service.rb Ask user explicitly about usage stats agreement 2018-09-07 14:32:28 +00:00
system_hooks_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
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 Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
upload_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
user_agent_detail_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
user_project_access_changed_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
validate_new_branch_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
verify_pages_domain_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00
web_hook_service.rb Enable frozen string in apps/uploaders/*.rb 2018-07-16 06:41:59 -07:00