Skip to content
Snippets Groups Projects
Commit 580b91c3 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix more subtle bugs with first_or_create

parent 48aeacd5
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ class ProcessInteractionService < BaseService
end
def favourite!(xml, from_account)
status(xml).favourites.first_or_create!(account: from_account)
status(xml).favourites.where(account: from_account).first_or_create!(account: from_account)
end
def add_post!(body, account)
......
......@@ -14,7 +14,7 @@ class ProcessMentionsService < BaseService
mentioned_account = follow_remote_account_service.("#{match.first}")
end
mentioned_account.mentions.first_or_create(status: status)
mentioned_account.mentions.where(status: status).first_or_create(status: status)
end
status.mentions.each do |mentioned_account|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment