From fe906e4fb6b36b1d5e3c796cf0a256a427a8b228 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 31 Jan 2017 18:31:25 +0000 Subject: [PATCH] Clean up sort orders. git-svn-id: http://svn.redmine.org/redmine/trunk@16321 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index f071010e2..942affe11 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -43,15 +43,15 @@ class Project < ActiveRecord::Base has_many :queries, :dependent => :delete_all has_many :documents, :dependent => :destroy has_many :news, lambda {includes(:author)}, :dependent => :destroy - has_many :issue_categories, lambda {order("#{IssueCategory.table_name}.name")}, :dependent => :delete_all - has_many :boards, lambda {order("position ASC")}, :dependent => :destroy - has_one :repository, lambda {where(["is_default = ?", true])} + has_many :issue_categories, lambda {order(:name)}, :dependent => :delete_all + has_many :boards, lambda {order(:position)}, :dependent => :destroy + has_one :repository, lambda {where(:is_default => true)} has_many :repositories, :dependent => :destroy has_many :changesets, :through => :repository has_one :wiki, :dependent => :destroy # Custom field for the project issues has_and_belongs_to_many :issue_custom_fields, - lambda {order("#{CustomField.table_name}.position")}, + lambda {order(:position)}, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :association_foreign_key => 'custom_field_id' -- 2.39.5