BigW Consortium Gitlab
Fix sorting issues/mrs by votes on the groups page Closes #14394 The `non_archived` scope applied here https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/concerns/issues_action.rb#L5 overrides the previous `ORDER BY` applied inside the IssuesFinder, with the default scope of the Project model, resulting in SQL errors. ```ruby Issue.reorder(created_at: :desc).joins(:project).to_sql => "SELECT issues.* FROM issues INNER JOIN projects ON projects.id = issues.project_id ORDER BY issues.created_at DESC" Issue.reorder(created_at: :desc).joins(:project).merge(Project.non_archived).to_sql => "SELECT issues.* FROM issues INNER JOIN projects ON projects.id = issues.project_id WHERE projects.archived = 'f' ORDER BY projects.id DESC" Issue.reorder(created_at: :desc).joins(:project).merge(Project.non_archived.only(:where)).to_sql => "SELECT issues.* FROM issues INNER JOIN projects ON projects.id = issues.project_id WHERE projects.archived = 'f' ORDER BY issues.created_at DESC" ``` /cc @yorickpeterse See merge request !3333
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
admin | Loading commit data... | |
ci | Loading commit data... | |
groups | Loading commit data... | |
import | Loading commit data... | |
profiles | Loading commit data... | |
projects | Loading commit data... | |
abuse_reports_controller_spec.rb | Loading commit data... | |
application_controller_spec.rb | Loading commit data... | |
autocomplete_controller_spec.rb | Loading commit data... | |
blob_controller_spec.rb | Loading commit data... | |
commit_controller_spec.rb | Loading commit data... | |
groups_controller_spec.rb | Loading commit data... | |
help_controller_spec.rb | Loading commit data... | |
invites_controller_spec.rb | Loading commit data... | |
namespaces_controller_spec.rb | Loading commit data... | |
projects_controller_spec.rb | Loading commit data... | |
root_controller_spec.rb | Loading commit data... | |
sent_notifications_controller_spec.rb | Loading commit data... | |
snippets_controller_spec.rb | Loading commit data... | |
uploads_controller_spec.rb | Loading commit data... | |
users_controller_spec.rb | Loading commit data... |