Class: Thredded::PrivateTopic

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Includes:
TopicCommon
Defined in:
app/models/thredded/private_topic.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TopicCommon

#last_user, #private?, #user

Class Method Details

.find_by_slug(slug) ⇒ Object



51
52
53
54
55
# File 'app/models/thredded/private_topic.rb', line 51

def self.find_by_slug(slug)
  friendly.find(slug)
rescue ActiveRecord::RecordNotFound
  raise Thredded::Errors::PrivateTopicNotFound
end

Instance Method Details

#public?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'app/models/thredded/private_topic.rb', line 57

def public?
  false
end

#should_generate_new_friendly_id?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'app/models/thredded/private_topic.rb', line 61

def should_generate_new_friendly_id?
  title_changed?
end