Add featured hashtags to profiles (#9755)
* Add hashtag filter to profiles GET /@:username/tagged/:hashtag GET /api/v1/accounts/:id/statuses?tagged=:hashtag * Display featured hashtags on public profile * Use separate model for featured tags * Update featured hashtag counters on-write * Limit featured tags to 10
This commit is contained in:
parent
d14c276e58
commit
364f2ff9aa
24 changed files with 238 additions and 8 deletions
|
@ -7,6 +7,7 @@ class CreateAccountModerationNotes < ActiveRecord::Migration[5.1]
|
|||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id
|
||||
end
|
||||
end
|
||||
|
|
12
db/migrate/20190203180359_create_featured_tags.rb
Normal file
12
db/migrate/20190203180359_create_featured_tags.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class CreateFeaturedTags < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :featured_tags do |t|
|
||||
t.references :account, foreign_key: { on_delete: :cascade }
|
||||
t.references :tag, foreign_key: { on_delete: :cascade }
|
||||
t.bigint :statuses_count, default: 0, null: false
|
||||
t.datetime :last_status_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue