Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from mastodon/main
Browse files Browse the repository at this point in the history
Fix not being able to follow more than one hashtag (mastodon#21285)
  • Loading branch information
corpy-rawr authored Nov 21, 2022
2 parents 771eeec + 51a33ce commit bc8ffd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def show
end

def follow
TagFollow.first_or_create!(tag: @tag, account: current_account, rate_limit: true)
TagFollow.create_with(rate_limit: true).find_or_create_by!(tag: @tag, account: current_account)
render json: @tag, serializer: REST::TagSerializer
end

Expand Down
4 changes: 4 additions & 0 deletions spec/controllers/api/v1/tags_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
end

describe 'POST #follow' do
let!(:unrelated_tag) { Fabricate(:tag) }

before do
TagFollow.create!(account: user.account, tag: unrelated_tag)

post :follow, params: { id: name }
end

Expand Down

0 comments on commit bc8ffd0

Please # to comment.