Skip to content

Commit

Permalink
fix: Show max 3 publications on ASCOR index page
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Dec 7, 2023
1 parent 49fc968 commit 25b6e6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/tpi/ascor_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class ASCORController < TPIController

def index
@assessment_dates = ASCOR::Assessment.pluck(:assessment_date).uniq
@publications_and_articles = Publication.joins(:tags).includes(:tpi_sectors).where(tags: {name: 'ASCOR'}) +
@publications_and_articles = (
Publication.joins(:tags).includes(:tpi_sectors).where(tags: {name: 'ASCOR'}) +
NewsArticle.joins(:tags).where(tags: {name: 'ASCOR'})
).uniq.sort_by(&:publication_date).reverse!.take(3)
ascor_page = TPIPage.find_by(slug: 'ascor')
@methodology_description = Content.find_by(page: ascor_page, code: 'methodology_description')
@methodology_id = Content.find_by(page: ascor_page, code: 'methodology_publication_id')
Expand Down

0 comments on commit 25b6e6c

Please sign in to comment.