]> source.dussan.org Git - redmine.git/commitdiff
Rails4: deprecated find_by methods with options at ApplicationHelper
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 14:11:03 +0000 (14:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 14:11:03 +0000 (14:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12491 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index bb7208e36075c414cbd030921dc28496b0cddc5c..cf7c11740fa9fec92fc2e18ba1d554a95e6fbf0f 100644 (file)
@@ -759,7 +759,8 @@ module ApplicationHelper
           oid = identifier.to_i
           case prefix
           when nil
-            if oid.to_s == identifier && issue = Issue.visible.find_by_id(oid, :include => :status)
+            if oid.to_s == identifier &&
+                  issue = Issue.visible.includes(:status).find_by_id(oid)
               anchor = comment_id ? "note-#{comment_id}" : nil
               link = link_to(h("##{oid}#{comment_suffix}"), {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid, :anchor => anchor},
                                         :class => issue.css_classes,
@@ -776,7 +777,7 @@ module ApplicationHelper
                                               :class => 'version'
             end
           when 'message'
-            if message = Message.visible.find_by_id(oid, :include => :parent)
+            if message = Message.visible.includes(:parent).find_by_id(oid)
               link = link_to_message(message, {:only_path => only_path}, :class => 'message')
             end
           when 'forum'