Skip to content

Commit

Permalink
[api] provide a default XML render for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Apr 15, 2013
1 parent c9b3c63 commit fca7d27
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/api/app/models/bs_request_action.rb
Expand Up @@ -153,14 +153,16 @@ def render_xml_target(node)
node.target attributes
end

def render_xml_attributes(node)
if [:submit, :maintenance_incident, :maintenance_release, :change_devel].include? self.action_type
render_xml_source(node)
render_xml_target(node)
end
end

def render_xml(builder)
builder.action :type => self.action_type do |action|
if [:submit, :maintenance_incident, :maintenance_release, :change_devel].include? self.action_type
render_xml_source(action)
render_xml_target(action)
else
render_xml_attributes(action)
end
render_xml_attributes(action)
if self.sourceupdate || self.updatelink
action.options do
action.sourceupdate self.sourceupdate if self.sourceupdate
Expand Down

0 comments on commit fca7d27

Please sign in to comment.