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

Enable ordering the BelongsTo fields by using order option.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/patrickgramatowski/enable-sort-by-association-attribute into main Jun 07, 2022
  • Overview 12
  • Commits 6
  • Pipelines 0
  • Changes 6

Created by: patrickgramatowski

Enable ordering the BelongsTo fields by using order option. The change let the gem users to be able to order the fields by the column they'll specify, instead of ordering by id.

I've also updated the query to solve the possible issues with PG::AmbiguousColumn errors - for now it's not handled in any way, so if the user is using the tables that use the same columns names, then the error will apear and the only way to fix that is to monkey patch the gem. To solve that, I've added the column name as the prefix for both possible forms of the query.

Based on #1215 And kinda related to #1805 the result is exactly as presented on videos attached to this task's description.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/patrickgramatowski/enable-sort-by-association-attribute