Skip to content

Commit

Permalink
Merge branch 'update-info-request-not-embargoed-query' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Oct 11, 2024
2 parents e18e072 + 84ebf2c commit 25142ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions app/models/info_request/prominence/not_embargoed_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ def initialize(relation = InfoRequest)
end

def call
# Specify an outer join as the default inner join
# will not retrieve NULL records which is what we want here
@relation
.select("info_requests.*")
.joins('LEFT OUTER JOIN embargoes
ON embargoes.info_request_id = info_requests.id')
.where('embargoes.id IS NULL')
.references(:embargoes)
@relation.left_joins(:embargo).where(embargoes: { id: nil })
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/statistics/leaderboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def all_time_requesters
joins(:user).
merge(User.active).
group(:user).
order(count_info_requests_all: :desc).
order(count_all: :desc).
limit(10).
count
end
Expand All @@ -18,7 +18,7 @@ def last_28_day_requesters
joins(:user).
merge(User.active).
group(:user).
order(count_info_requests_all: :desc).
order(count_all: :desc).
limit(10).
count
end
Expand Down

0 comments on commit 25142ac

Please sign in to comment.