kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
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.
48 lines
1.3 KiB
48 lines
1.3 KiB
10 years ago
|
#-- copyright
|
||
10 years ago
|
# OpenProject Costs Plugin
|
||
10 years ago
|
#
|
||
10 years ago
|
# Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF)
|
||
10 years ago
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License
|
||
10 years ago
|
# version 3.
|
||
10 years ago
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
#++
|
||
|
|
||
|
require 'roar/decorator'
|
||
10 years ago
|
require 'roar/json/hal'
|
||
10 years ago
|
|
||
|
module API
|
||
|
module V3
|
||
10 years ago
|
module Budgets
|
||
10 years ago
|
class BudgetRepresenter < ::API::Decorators::Single
|
||
8 years ago
|
self_link title_getter: ->(*) { represented.subject }
|
||
6 years ago
|
include API::Caching::CachedRepresenter
|
||
|
include ::API::V3::Attachments::AttachableRepresenterMixin
|
||
6 years ago
|
|
||
9 years ago
|
link :staticPath do
|
||
6 years ago
|
next if represented.new_record?
|
||
9 years ago
|
{
|
||
8 years ago
|
href: cost_object_path(represented.id)
|
||
9 years ago
|
}
|
||
|
end
|
||
|
|
||
10 years ago
|
property :id, render_nil: true
|
||
|
property :subject, render_nil: true
|
||
|
|
||
|
def _type
|
||
10 years ago
|
'Budget'
|
||
10 years ago
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|