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

Orm adapters

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/mrbrdo/orm_adapters into master Feb 17, 2016
  • Overview 1
  • Commits 6
  • Pipelines 0
  • Changes 24

Created by: mrbrdo

#143 (closed) This works well for us with the Sequel adapter.

There is only one concern I still have. Right now I wrap models/records/relations into wrapper objects as soon as possible. This unfortunately means that if the user overrides something (e.g. a view), he will get wrapper objects instead of actual AR records. The wrapper does proxy all methods to the actual record, and it defines to_model so polymorphic_url works properly, but I'm not sure if this is the best solution.

I see 2 possible alternatives:

  • include a module into the base classes that adds a method such as #agnostic, which returns the wrapper. then go through this method inside administrate
  • use class methods ("helpers") instead of wrappers, and use that in administrate instead of calling methods on the records/models/relations

The spec failures are due to equality checks (wrapper object with wrapped object).

Or keep the current approach if it's good enough. What do you think?

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mrbrdo/orm_adapters