• Yorick Peterse's avatar
    Clean up ActiveRecord code in TodoService · 38b8ae64
    Yorick Peterse authored
    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.
    38b8ae64
Name
Last commit
Last update
..
application_settings Loading commit data...
applications Loading commit data...
auth Loading commit data...
badges Loading commit data...
boards Loading commit data...
chat_names Loading commit data...
ci Loading commit data...
clusters Loading commit data...
commits Loading commit data...
concerns Loading commit data...
deploy_keys Loading commit data...
deploy_tokens Loading commit data...
discussions Loading commit data...
emails Loading commit data...
events Loading commit data...
files Loading commit data...
gpg_keys Loading commit data...
groups Loading commit data...
issuable Loading commit data...
issues Loading commit data...
keys Loading commit data...
labels Loading commit data...
lfs Loading commit data...
mattermost Loading commit data...
members Loading commit data...
merge_requests Loading commit data...
milestones Loading commit data...
notes Loading commit data...
projects Loading commit data...
prometheus Loading commit data...
protected_branches Loading commit data...
protected_tags Loading commit data...
quick_actions Loading commit data...
resource_events Loading commit data...
search Loading commit data...
tags Loading commit data...
test_hooks Loading commit data...
todos/destroy Loading commit data...
users Loading commit data...
wiki_pages Loading commit data...
wikis Loading commit data...
access_token_validation_service.rb Loading commit data...
after_branch_delete_service.rb Loading commit data...
akismet_service.rb Loading commit data...
audit_event_service.rb Loading commit data...
base_count_service.rb Loading commit data...
base_renderer.rb Loading commit data...
base_service.rb Loading commit data...
cohorts_service.rb Loading commit data...
compare_service.rb Loading commit data...
create_branch_service.rb Loading commit data...
create_deployment_service.rb Loading commit data...
create_release_service.rb Loading commit data...
create_snippet_service.rb Loading commit data...
delete_branch_service.rb Loading commit data...
delete_merged_branches_service.rb Loading commit data...
event_create_service.rb Loading commit data...
git_push_service.rb Loading commit data...
git_tag_push_service.rb Loading commit data...
gravatar_service.rb Loading commit data...
ham_service.rb Loading commit data...
import_export_clean_up_service.rb Loading commit data...
issuable_base_service.rb Loading commit data...
merge_request_metrics_service.rb Loading commit data...
metrics_service.rb Loading commit data...
note_summary.rb Loading commit data...
notification_recipient_service.rb Loading commit data...
notification_service.rb Loading commit data...
preview_markdown_service.rb Loading commit data...
push_event_payload_service.rb Loading commit data...
repair_ldap_blocked_user_service.rb Loading commit data...
repository_archive_clean_up_service.rb Loading commit data...
reset_project_cache_service.rb Loading commit data...
search_service.rb Loading commit data...
spam_check_service.rb Loading commit data...
spam_service.rb Loading commit data...
submit_usage_ping_service.rb Loading commit data...
system_hooks_service.rb Loading commit data...
system_note_service.rb Loading commit data...
todo_service.rb Loading commit data...
update_release_service.rb Loading commit data...
update_snippet_service.rb Loading commit data...
upload_service.rb Loading commit data...
user_agent_detail_service.rb Loading commit data...
user_project_access_changed_service.rb Loading commit data...
validate_new_branch_service.rb Loading commit data...
verify_pages_domain_service.rb Loading commit data...
web_hook_service.rb Loading commit data...