Fix more subtle bugs with first_or_create
This commit is contained in:
parent
48aeacd5f9
commit
580b91c387
|
@ -62,7 +62,7 @@ class ProcessInteractionService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def favourite!(xml, from_account)
|
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
|
end
|
||||||
|
|
||||||
def add_post!(body, account)
|
def add_post!(body, account)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ProcessMentionsService < BaseService
|
||||||
mentioned_account = follow_remote_account_service.("#{match.first}")
|
mentioned_account = follow_remote_account_service.("#{match.first}")
|
||||||
end
|
end
|
||||||
|
|
||||||
mentioned_account.mentions.first_or_create(status: status)
|
mentioned_account.mentions.where(status: status).first_or_create(status: status)
|
||||||
end
|
end
|
||||||
|
|
||||||
status.mentions.each do |mentioned_account|
|
status.mentions.each do |mentioned_account|
|
||||||
|
|
Loading…
Reference in New Issue