From 9d67cffc1579d4b5a22edcfb4076cb5d1cd13f61 Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Mon, 12 Aug 2013 11:59:35 +0200 Subject: [PATCH] Adapts changes to journalization API --- app/controllers/journals_controller.rb | 7 ++++--- app/controllers/work_packages_controller.rb | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) 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