OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/api/v2/planning_element_journals/_journal.api.rsb

39 lines
958 B

#-- copyright
# OpenProject is a project management system.
#
# Copyright (C) 2012-2013 the OpenProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
api.journal do
api.id(journal.version)
api.user(:id => journal.user.id, :name => journal.user.name)
api.notes(journal.notes)
api.array(:changes, :size => journal.changed_data.size) do
journal.changed_data.each do |attribute, changes|
api.change do
api.technical do
api.name(attribute)
api.old(changes.first)
api.new(changes.last)
end
attribute, old, new = user_friendly_change(journal, attribute)
api.user_friendly do
api.name(attribute)
api.old(old)
api.new(new)
end
end
end
end
api.created_on(journal.created_on.utc)
end