Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

remove unnecessary redefinition of order_by_name scope

Markus Kahl5e795a844a18
diff --git a/app/models/version.rb b/app/models/version.rb
index 30091938fcd..810cab18325 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -58,7 +58,7 @@ class Version < ApplicationRecord
scope :systemwide, -> { where(sharing: 'system') }
- scope :order_by_name, -> { order(Arel.sql("LOWER(#{Version.table_name}.name)")) }
+ scope :order_by_name, -> { order(Arel.sql("LOWER(#{Version.table_name}.name) ASC")) }
def self.with_status_open
where(status: 'open')
diff --git a/modules/backlogs/app/models/sprint.rb b/modules/backlogs/app/models/sprint.rb
index ca7056b0da2..a8202670f7c 100644
--- a/modules/backlogs/app/models/sprint.rb
+++ b/modules/backlogs/app/models/sprint.rb
@@ -38,9 +38,6 @@ class Sprint < Version
scope :order_by_date, -> {
reorder(Arel.sql("start_date ASC NULLS LAST, effective_date ASC NULLS LAST"))
}
- scope :order_by_name, -> {
- order Arel.sql("#{Version.table_name}.name ASC")
- }
scope :apply_to, lambda { |project|
where("#{Version.table_name}.project_id = #{project.id}" +