Rails4: deprecated find_by methods with options at ApplicationHelper

git-svn-id: http://svn.redmine.org/redmine/trunk@12491 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-07 14:11:03 +00:00
parent a8c8266b9d
commit f8df0e729c
1 changed files with 3 additions and 2 deletions

View 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'