Top posts test
Some checks are pending
Check i18n / check-i18n (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Check formatting / lint (push) Waiting to run
JavaScript Linting / lint (push) Waiting to run
Ruby Linting / lint (push) Waiting to run
JavaScript Testing / test (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Waiting to run
Historical data migration test / test (15-alpine) (push) Waiting to run
Historical data migration test / test (16-alpine) (push) Waiting to run
Historical data migration test / test (17-alpine) (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / Libvips tests (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (push) Blocked by required conditions
Ruby Testing / Back to original and return test (push) Blocked by required conditions
Some checks are pending
Check i18n / check-i18n (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Check formatting / lint (push) Waiting to run
JavaScript Linting / lint (push) Waiting to run
Ruby Linting / lint (push) Waiting to run
JavaScript Testing / test (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Waiting to run
Historical data migration test / test (15-alpine) (push) Waiting to run
Historical data migration test / test (16-alpine) (push) Waiting to run
Historical data migration test / test (17-alpine) (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / Libvips tests (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (push) Blocked by required conditions
Ruby Testing / Back to original and return test (push) Blocked by required conditions
This commit is contained in:
parent
725811a2e3
commit
16a2f4fb9e
8 changed files with 90 additions and 2 deletions
15
app/services/local_top_posts_service.rb
Normal file
15
app/services/local_top_posts_service.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class LocalTopPostsService < BaseService
|
||||
# Rank local posts by engagement (boosts > favs > replies) in last 24h
|
||||
def call
|
||||
Status
|
||||
.local
|
||||
.joins(:status_stat)
|
||||
.where('statuses.created_at > ?', 24.hours.ago)
|
||||
.select('statuses.*,
|
||||
(status_stats.reblogs_count * 0.6 +
|
||||
status_stats.favourites_count * 0.3 +
|
||||
status_stats.replies_count * 0.1) AS engagement_score')
|
||||
.order('engagement_score DESC')
|
||||
.limit(50) # Adjust as needed
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue