Class: Thredded::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
PostCommon
Defined in:
app/models/thredded/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)


20
21
22
# File 'app/models/thredded/post.rb', line 20

def private_topic_post?
  false
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.



25
26
27
28
29
# File 'app/models/thredded/post.rb', line 25

def readers_from_user_names(user_names)
  DbTextSearch::CaseInsensitiveEq
    .new(Thredded.user_class.thredded_messageboards_readers([messageboard]), Thredded.user_name_column)
    .find(user_names)
end