Class: Thredded::PrivatePost
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Thredded::PrivatePost
- Includes:
- PostCommon
- Defined in:
- app/models/thredded/private_post.rb
Instance Method Summary collapse
- #page(per_page: self.class.default_per_page) ⇒ Object
- #private_topic_post? ⇒ Boolean
-
#readers_from_user_names(user_names) ⇒ ActiveRecord::Relation<Thredded.user_class>
Users from the list of user names that can read this post.
Methods included from PostCommon
#avatar_url, #calculate_page, #filtered_content
Instance Method Details
#page(per_page: self.class.default_per_page) ⇒ Object
22 23 24 |
# File 'app/models/thredded/private_post.rb', line 22 def page(per_page: self.class.default_per_page) calculate_page(postable.posts, per_page) end |
#private_topic_post? ⇒ Boolean
26 27 28 |
# File 'app/models/thredded/private_post.rb', line 26 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.
31 32 33 34 35 |
# File 'app/models/thredded/private_post.rb', line 31 def readers_from_user_names(user_names) DbTextSearch::CaseInsensitive .new(postable.users, Thredded.user_name_column) .in(user_names) end |