diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index ab97afc51d..0bd8f59e5c 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -63,8 +63,9 @@ class JournalsController < ApplicationController def diff if valid_field?(params[:field]) - from = @journal.changed_data[params[:field]][0] - to = @journal.changed_data[params[:field]][1] + field = params[:field].parameterize.underscore.to_sym + from = @journal.changed_data[field][0] + to = @journal.changed_data[field][1] @diff = Redmine::Helpers::Diff.new(to, from) @journaled = @journal.journaled @@ -81,7 +82,7 @@ class JournalsController < ApplicationController def find_journal @journal = Journal.find(params[:id]) - @project = @journal.journalized.project + @project = @journal.journaled.project rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rb index 8f328c70a0..9ec3e91804 100644 --- a/app/controllers/work_packages_controller.rb +++ b/app/controllers/work_packages_controller.rb @@ -200,8 +200,7 @@ class WorkPackagesController < ApplicationController end def journals - @journals ||= work_package.journals.changing - .includes(:user, :journaled) + @journals ||= work_package.journals.includes(:user) .order("#{Journal.table_name}.created_at ASC") end