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

Make Field#options public, enabling access from templates

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pablo Brasero requested to merge github/fork/pablobm/public-options into master Jan 01, 2020
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Over at https://github.com/thoughtbot/administrate/issues/612, a fair point was made: if field options were public, they could be accessed from templates. This would enable users to customize fields without having to create new field types, which I find a bit more cumbersome.

An argument against this change would be that it increases the contact surface of field types, which can be an issue later if we change the interface of fields.

An argument for this change would be that the interface of fields is unlikely to change radically at this point. If it did, probably subclasses would have to change anyway too, possibly forcing more significant changes than that of how to access the options.

I'm not 100% sure about this one. I'd like to hear more opinions, use cases, etc. So here's a PR, which hopefully will bring some feedback.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/public-options