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
  • !1059

Use associated_class to render belongs_to links

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/DevinFrenze/master into master Dec 22, 2017
  • Overview 24
  • Commits 1
  • Pipelines 0
  • Changes 10

Created by: DevinFrenze

Use associated_class to render belongs_to links

The class_name option that allows an associative field to render the proper class / dashboard was not previously accounted for when validating whether or not to link to a belongs_to resource in the belongs_to index and show partials.

The following actions were taken:

  • Add documentation for class_name in customizing_dashboards
  • Make associated_class a public method for associative fields
  • Call valid_action? with associated_class in belongs_to partials
  • Test that valid_action? is called with correct value
  • Test that the link is rendered when action is valid

Note:

  • When running appraisal install, gem pundit was added several times to the gemfile
  • The test that is failing is the same test that is failing on master
  • This PR follows up on https://github.com/thoughtbot/administrate/issues/1050
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/DevinFrenze/master