about summary refs log tree commit diff
path: root/app/lib/tag_manager.rb
diff options
context:
space:
mode:
authorAkihiko Odaki (@fn_aki@pawoo.net) <akihiko.odaki.4i@stu.hosei.ac.jp>2017-06-04 23:14:25 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-04 16:14:25 +0200
commite07b57852e951efebae7e2380a3691236420072d (patch)
treea5f4ec469eb511abe451cc5f5091aed9be2cd22d /app/lib/tag_manager.rb
parent7c7c18fdea52ce288a87d2455f1efc55f74af003 (diff)
Remove some code in TagManager and spec (#3547)
* Do not fall back to StreamEntry if object_type is unavailable in TagManager

Since 6d6a429af8fe4bd92ed497f401676353fdc603e0, 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
Diffstat (limited to 'app/lib/tag_manager.rb')
-rw-r--r--app/lib/tag_manager.rb4
1 files changed, 0 insertions, 4 deletions
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb
index 55aed92e3..f1a2234dc 100644
--- a/app/lib/tag_manager.rb
+++ b/app/lib/tag_manager.rb
@@ -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