Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Oct 17, 2023
2 parents f9654f4 + 462f996 commit 1f27a09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/tpi/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def index
stats: {
companies_count: Company.published.count,
countries_count: Company.select(:geography_id).distinct.count,
supporters_count: TPIPage.find_by(slug: 'supporters')&.contents&.flat_map(&:images)&.count,
supporters_count: TPIPage.find_by(slug: 'supporters')&.contents&.flat_map(&:images)&.count.to_i +
page&.contents&.find_by(code: 'supporters_without_logo')&.text.to_i,
total_market_cap: page&.contents&.find_by(code: 'total_market_cap')&.text || '-',
combined_aum: page&.contents&.find_by(code: 'combined_aum')&.text || '-',
sectors_count: TPISector.with_companies.count
Expand Down
2 changes: 2 additions & 0 deletions app/models/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def simple_text?
%w[
total_market_cap
sectors
supporters_without_logo
combined_aum
methodology_publication_id
].include? code
Expand All @@ -42,6 +43,7 @@ def static_content?
%w[
total_market_cap
sectors
supporters_without_logo
combined_aum
methodology_description
methodology_publication_id
Expand Down

0 comments on commit 1f27a09

Please sign in to comment.