Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into develop

This commit is contained in:
mgabdev 2020-07-10 15:53:05 -05:00
commit 7c897d69a2
2 changed files with 17 additions and 2 deletions

View File

@ -342,12 +342,12 @@ class Status < ApplicationRecord
end
def as_pro_timeline(account = nil)
query = timeline_scope.without_replies.popular_accounts.where('statuses.created_at > ?', 2.hours.ago)
query = timeline_scope.without_replies.popular_accounts.where('statuses.updated_at > ?', 2.hours.ago)
apply_timeline_filters(query, account)
end
def as_public_timeline(account = nil)
query = timeline_scope.without_replies.where('statuses.created_at > ?', 15.minutes.ago)
query = timeline_scope.without_replies.where('statuses.updated_at > ?', 15.minutes.ago)
apply_timeline_filters(query, account)
end

View File

@ -0,0 +1,15 @@
class AddProUsersFeedMaterializedView < ActiveRecord::Migration[5.2]
def change
safety_assured {
execute <<-SQL
CREATE MATERIALIZED VIEW pro_feed_users_matview AS
SELECT id
FROM accounts
WHERE accounts.is_investor=true
OR accounts.is_donor=true
OR accounts.is_verified=true
OR accounts.is_pro=true
SQL
}
end
end