Adapts changes to journalization API

pull/312/head
Hagen Schink 11 years ago
parent 0e79c7de73
commit 9d67cffc15
  1. 7
      app/controllers/journals_controller.rb
  2. 3
      app/controllers/work_packages_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

@ -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

Loading…
Cancel
Save