6f3c490107
This refactors the AutocompleteController according to the guidelines and boundaries discussed in https://gitlab.com/gitlab-org/gitlab-ce/issues/49653. Specifically, ActiveRecord logic is moved to different finders, which are then used in the controller. View logic in turn is moved to presenters, instead of directly using ActiveRecord's "to_json" method. The finder MoveToProjectFinder is also adjusted according to the abstraction guidelines and boundaries, resulting in a much more simple finder. By using finders (and other abstractions) more actively, we can push a lot of logic out of the controller. We also remove the need for various "before_action" hooks, though this could be achieved without using finders as well. The various finders related to AutcompleteController have also been moved into a namespace. This removes the need for calling everything "AutocompleteSmurfFinder", instead you can use "Autocomplete::SmurfFinder". |
||
---|---|---|
.. | ||
analytics_build_entity_spec.rb | ||
analytics_build_serializer_spec.rb | ||
analytics_issue_entity_spec.rb | ||
analytics_issue_serializer_spec.rb | ||
analytics_merge_request_serializer_spec.rb | ||
analytics_stage_serializer_spec.rb | ||
analytics_summary_serializer_spec.rb | ||
blob_entity_spec.rb | ||
build_action_entity_spec.rb | ||
build_artifact_entity_spec.rb | ||
build_details_entity_spec.rb | ||
build_serializer_spec.rb | ||
cluster_application_entity_spec.rb | ||
cluster_entity_spec.rb | ||
cluster_serializer_spec.rb | ||
commit_entity_spec.rb | ||
container_repository_entity_spec.rb | ||
container_tag_entity_spec.rb | ||
deploy_key_entity_spec.rb | ||
deployment_entity_spec.rb | ||
diff_file_entity_spec.rb | ||
diffs_entity_spec.rb | ||
discussion_entity_spec.rb | ||
entity_date_helper_spec.rb | ||
entity_request_spec.rb | ||
environment_entity_spec.rb | ||
environment_serializer_spec.rb | ||
group_child_entity_spec.rb | ||
group_child_serializer_spec.rb | ||
group_variable_entity_spec.rb | ||
issue_entity_spec.rb | ||
issue_serializer_spec.rb | ||
job_entity_spec.rb | ||
label_serializer_spec.rb | ||
lfs_file_lock_entity_spec.rb | ||
merge_request_basic_serializer_spec.rb | ||
merge_request_diff_entity_spec.rb | ||
merge_request_serializer_spec.rb | ||
merge_request_user_entity_spec.rb | ||
merge_request_widget_entity_spec.rb | ||
move_to_project_entity_spec.rb | ||
move_to_project_serializer_spec.rb | ||
note_entity_spec.rb | ||
pipeline_details_entity_spec.rb | ||
pipeline_entity_spec.rb | ||
pipeline_serializer_spec.rb | ||
project_mirror_serializer_spec.rb | ||
project_note_entity_spec.rb | ||
request_aware_entity_spec.rb | ||
runner_entity_spec.rb | ||
stage_entity_spec.rb | ||
status_entity_spec.rb | ||
test_case_entity_spec.rb | ||
test_reports_comparer_entity_spec.rb | ||
test_reports_comparer_serializer_spec.rb | ||
test_suite_comparer_entity_spec.rb | ||
user_entity_spec.rb | ||
variable_entity_spec.rb |