Class: Thredded::UserPrivateTopicDecorator

Inherits:
BaseUserTopicDecorator show all
Defined in:
app/decorators/thredded/user_private_topic_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseUserTopicDecorator

#css_class, decorate_all, decorator_class, #initialize, model_name, #persisted?, #read_status_class, #to_ary, #to_model

Constructor Details

This class inherits a constructor from Thredded::BaseUserTopicDecorator

Class Method Details

.topic_class ⇒ Object



5
6
7
# File 'app/decorators/thredded/user_private_topic_decorator.rb', line 5

def self.topic_class
  PrivateTopic
end

Instance Method Details

#read? ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/decorators/thredded/user_private_topic_decorator.rb', line 9

def read?
  topic.private_users.find_by(user: user).try(:read?)
end