]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated #connection from Issue model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 01:06:58 +0000 (01:06 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 01:06:58 +0000 (01:06 +0000)
DEPRECATION WARNING: #connection is deprecated in favour of accessing it via the class.

git-svn-id: http://svn.redmine.org/redmine/trunk@12715 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index fec0568e3acf1526209e51cce70f65ec642b2204..d58787b318929772909366a6f5e4d08379cf5210 100644 (file)
@@ -1361,7 +1361,7 @@ class Issue < ActiveRecord::Base
           end
           done = p.leaves.joins(:status).
             sum("COALESCE(CASE WHEN estimated_hours > 0 THEN estimated_hours ELSE NULL END, #{average}) " +
-                "* (CASE WHEN is_closed = #{connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)").to_f
+                "* (CASE WHEN is_closed = #{ActiveRecord::Base.connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)").to_f
           progress = done / (average * leaves_count)
           p.done_ratio = progress.round
           p.done_ratio = 100 if p.done_ratio > 100