0
0
Fork 0

Remove some code in TagManager and spec (#3547)

* Do not fall back to StreamEntry if object_type is unavailable in TagManager

Since 6d6a429af8, when Status, the only model
with stream_entry, and StreamEntry got its own logic in uri_for and
url_for, the purpose of the fallbacks to activity_type of StreamEntry
became unclear.

This commit removes the fallbacks. When adding another model with
stream_entry in future, consider to update uri_for and url_for.

* Cover TagManager more
This commit is contained in:
Akihiko Odaki (@fn_aki@pawoo.net) 2017-06-04 23:14:25 +09:00 committed by Eugen Rochko
parent 7c7c18fdea
commit e07b57852e
2 changed files with 193 additions and 32 deletions

View file

@ -93,8 +93,6 @@ class TagManager
account_url(target)
when :note, :comment, :activity
unique_tag(target.created_at, target.id, 'Status')
else
unique_tag(target.stream_entry.created_at, target.stream_entry.activity_id, target.stream_entry.activity_type)
end
end
@ -106,8 +104,6 @@ class TagManager
short_account_url(target)
when :note, :comment, :activity
short_account_status_url(target.account, target)
else
account_stream_entry_url(target.account, target.stream_entry)
end
end
end