Class: Thredded::PrivatePost

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
PostCommon
Defined in:
app/models/thredded/private_post.rb

Instance Method Summary collapse

Methods included from PostCommon

#avatar_url, #filtered_content, #user_anonymous?

Instance Method Details

#private_topic_post? ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/thredded/private_post.rb', line 14

def private_topic_post?
  true
end

#readers_from_user_names(user_names) ⇒ ActiveRecord::Relation<Thredded.user_class>

Returns users from the list of user names that can read this post.

Returns:

  • (ActiveRecord::Relation<Thredded.user_class>) —

    users from the list of user names that can read this post.



19
20
21
22
23
# File 'app/models/thredded/private_post.rb', line 19

def readers_from_user_names(user_names)
  DbTextSearch::CaseInsensitiveEq
    .new(postable.users, Thredded.user_name_column)
    .find(user_names)
end