Skip to content

Commit 7abcf86

Browse files
committed
Remove method duplicated during cherry-pick and add comment
1 parent b76c91b commit 7abcf86

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

app/models/comment_thread.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ class CommentThread < ApplicationRecord
1616

1717
after_create :create_follower
1818

19-
# Are there any threads on a given post that a given user follows?
20-
# @param post [Post] post to check
21-
# @param user [User] user to check
22-
# @return [Boolean] check result
23-
def self.post_followed?(post, user)
24-
ThreadFollower.where(post: post, user: user).any?
25-
end
26-
2719
# Is the thread read-only (can't be edited)?
2820
# @return [Boolean] check result
2921
def read_only?

app/models/post.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ def reaction_list
234234
.to_h { |_k, v| [v.first.reaction_type, v] }
235235
end
236236

237+
# Are new threads on this post followed by this user?
238+
# @param post [Post] post to check
239+
# @param user [User] user to check
240+
# @return [Boolean] check result
237241
def followed_by?(user)
238242
ThreadFollower.where(post: self, user: user).any?
239243
end

0 commit comments

Comments
 (0)