]> source.dussan.org Git - redmine.git/commitdiff
Fixed SQL errors with SQLServer (column specified more than once in the order by...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 29 Oct 2014 22:30:25 +0000 (22:30 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 29 Oct 2014 22:30:25 +0000 (22:30 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13527 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/enumeration.rb
app/models/project.rb

index 585eb945a248433ad0e3b24b7cac59f627fd8180..9e547169d745c6e8b1d5526250466f5ee325b504 100644 (file)
@@ -18,7 +18,7 @@
 class Enumeration < ActiveRecord::Base
   include Redmine::SubclassFactory
 
-  default_scope lambda {order("#{Enumeration.table_name}.position ASC")}
+  default_scope lambda {order(:position)}
 
   belongs_to :project
 
index 19108b2a36390441e7821f634bb147a9306fcedb..f29f50f2148270f7bdc67ee3ac71832e173043f6 100644 (file)
@@ -37,7 +37,7 @@ class Project < ActiveRecord::Base
                     where("#{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}")},
     :class_name => 'Member'
   has_many :enabled_modules, :dependent => :delete_all
-  has_and_belongs_to_many :trackers, lambda {order("#{Tracker.table_name}.position")}
+  has_and_belongs_to_many :trackers, lambda {order(:position)}
   has_many :issues, :dependent => :destroy
   has_many :issue_changes, :through => :issues, :source => :journals
   has_many :versions, lambda {order("#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC")}, :dependent => :destroy