Skip to content

Commit

Permalink
Updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
aunindadf committed Apr 21, 2016
1 parent 82d2282 commit bf1dc5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions helpers/country_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ def get_country_all_projects_data(countryCode)
allProjectsData['project_budget_higher_bound'] = 0
allProjectsData['actualStartDate'] = '1990-01-01T00:00:00'
allProjectsData['plannedEndDate'] = '2000-01-01T00:00:00'
unless allProjectsData['projects']['results'][0].nil?
allProjectsData['project_budget_higher_bound'] = allProjectsData['projects']['results'][0]['aggregations']['activity_children']['budget_value']
end
unless allProjectsData['projects']['results'][0].nil?
allProjectsData['project_budget_higher_bound'] = allProjectsData['projects']['results'][0]['aggregations']['activity_children']['budget_value']
end
# allProjectsData['actualStartDate'] = RestClient.get settings.oipa_api_url + "activities?format=json&page_size=1&fields=activity_dates&reporting_organisation=GB-GOV-1&hierarchy=1&related_activity_recipient_country=#{countryCode}&ordering=actual_start_date&start_date_gte=1900-01-02"
# allProjectsData['actualStartDate'] = JSON.parse(allProjectsData['actualStartDate'])
# tempStartDate = allProjectsData['actualStartDate']['results'][0]['activity_dates'].select{|activityDate| activityDate['type']['code'] == '2'}.first
Expand Down
6 changes: 3 additions & 3 deletions helpers/region_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def get_region_projects(n)
results['project_budget_higher_bound'] = 0
results['actualStartDate'] = '1990-01-01T00:00:00'
results['plannedEndDate'] = '2000-01-01T00:00:00'
unless projects['results'][0].nil?
results['project_budget_higher_bound'] = projects['results'][0]['aggregations']['activity_children']['budget_value']
end
unless projects['results'][0].nil?
results['project_budget_higher_bound'] = projects['results'][0]['aggregations']['activity_children']['budget_value']
end
# results['actualStartDate'] = RestClient.get settings.oipa_api_url + "activities/?format=json&page_size=1&fields=activity_dates&reporting_organisation=GB-GOV-1&hierarchy=1&related_activity_recipient_region=#{n}&ordering=actual_start_date&start_date_gte=1900-01-02"
# results['actualStartDate'] = JSON.parse(results['actualStartDate'])
# tempStartDate = results['actualStartDate']['results'][0]['activity_dates'].select{|activityDate| activityDate['type']['code'] == '2'}.first
Expand Down
6 changes: 3 additions & 3 deletions helpers/sector_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def get_sector_projects(n)
results['project_budget_higher_bound'] = 0
results['actualStartDate'] = '1990-01-01T00:00:00'
results['plannedEndDate'] = '2000-01-01T00:00:00'
unless projects['results'][0].nil?
results['project_budget_higher_bound'] = projects['results'][0]['aggregations']['activity_children']['budget_value']
end
unless projects['results'][0].nil?
results['project_budget_higher_bound'] = projects['results'][0]['aggregations']['activity_children']['budget_value']
end
# results['actualStartDate'] = RestClient.get settings.oipa_api_url + "activities/?format=json&page_size=1&fields=activity_dates&reporting_organisation=GB-GOV-1&hierarchy=1&related_activity_sector=#{n}&ordering=actual_start_date&start_date_gte=1900-01-02"
# results['actualStartDate'] = JSON.parse(results['actualStartDate'])
# tempStartDate = results['actualStartDate']['results'][0]['activity_dates'].select{|activityDate| activityDate['type']['code'] == '2'}.first
Expand Down

0 comments on commit bf1dc5b

Please sign in to comment.