Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !50

Propose refactor for resource resolution (WIP)

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge jro-resource-resolver into master Jun 30, 2015
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: jayroh

There are quite a few private methods that do some work translating the concept of "this controller" to a name, a title, a class, etc.

In attempting to implement dashboards for some namespaced models I ran into some limitations with the current code. I made an attempt below to pull together the private methods that fall into the scope of what I would call a "resource resolver" (or maybe a "resource factory"?). Delegating to an object that returned the type of information, or objects, that we want from the controller's path sounds like a reasonable abstraction.

The base administrate application controller would ideally and eventually delegate the updated methods to ResourceResolver.new(controller_path).

The changed methods below are to illustrate a collection of base use cases and how they would end up looking.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: jro-resource-resolver