Skip to content

Commit

Permalink
update reporting organisation name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tetrahedra committed Oct 16, 2015
1 parent 9bf9eba commit 3f251ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions helpers/project_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def sum_budget_value(projectBudgets)
if !projectBudgets.nil? && projectBudgets.length > 0 then
summedBudgets = projectBudgets.reduce(0) {|memo, t| memo + t[1].to_f}
else
summedBudgets =0
summedBudgets = 0
end
end

Expand All @@ -355,11 +355,11 @@ def get_funding_project_Details(projectId)
#fundingProject = fundingProjectDetails['results'][0]
end

def reporting_organisation(org)
def reporting_organisation(project)
begin
reporting_organisation = org[0]['narratives'][0]['text']
organisation = project['reporting_organisation'][0]['narratives'][0]['text']
rescue
reporting_organisation = org[0]['type']['name']
organisation = project['reporting_organisation'][0]['type']['name']
end
end

Expand Down
2 changes: 1 addition & 1 deletion views/partials/_projects-header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= project['title']['narratives'][0]['text'] %> <small>[<%= project['iati_identifier'] %>]</small>
</h1>
<h2>
<%= reporting_organisation(project['reporting_organisation']) %>
<%= reporting_organisation(project) %>
</h2>
</div>
</div>
Expand Down

0 comments on commit 3f251ec

Please sign in to comment.