]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated find_by_id at Changeset class
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 29 Dec 2013 13:49:09 +0000 (13:49 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 29 Dec 2013 13:49:09 +0000 (13:49 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12473 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/changeset.rb

index ff210e9b89330d56b8ab8ed27c530a90d34344bc..36598112495c2a9072ff0ac6181a973f4dda8f9e 100644 (file)
@@ -197,7 +197,7 @@ class Changeset < ActiveRecord::Base
   # Finds an issue that can be referenced by the commit message
   def find_referenced_issue_by_id(id)
     return nil if id.blank?
-    issue = Issue.find_by_id(id.to_i, :include => :project)
+    issue = Issue.includes(:project).where(:id => id.to_i).first
     if Setting.commit_cross_project_ref?
       # all issues can be referenced/fixed
     elsif issue