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

Left join in order to support searching both a belongs_to and a field…

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/motdotla/master into master Jul 31, 2019
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: motdotla

… on the root entity

First, I love Administrate. ♥ Thank you for creating such a straightforward yet reasonably customizable dashboard. It hits the perfect sweet spot.

This PR is to fix a search issue I ran up against.

In the scenario, where I have configured search to both a belongs_to searchable_field AND some other_field in the root entity, the following happens:

  1. I can successfully search the belongs_to belongs_to.searchable_field when the root entity's belongs_to is assigned
  2. I can successfully search the belongs_to belongs_to.searchable_field when the root entity's belongs_to is null
  3. I can successfully search the other_field when the root entity's belongs_to is assigned
  4. I can NOT successfully search the other_field when the root entity's belongs_to is null

This PR fixes problem #4 (caused by an inner join) by using a left join.

Is this PR useful?

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/motdotla/master