Class: Thredded::PrivateTopic
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Thredded::PrivateTopic
show all
- Extended by:
- FriendlyId
- Includes:
- TopicCommon
- Defined in:
- app/models/thredded/private_topic.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#last_user, #private?, #user
Class Method Details
Finds the topic by its slug or ID, or raises Thredded::Errors::PrivateTopicNotFound.
58
59
60
61
62
|
# File 'app/models/thredded/private_topic.rb', line 58
def self.friendly_find!(slug_or_id)
friendly.find(slug_or_id)
rescue ActiveRecord::RecordNotFound
raise Thredded::Errors::PrivateTopicNotFound
end
|
Instance Method Details
#normalize_friendly_id(input) ⇒ Object
72
73
74
|
# File 'app/models/thredded/private_topic.rb', line 72
def normalize_friendly_id(input)
Thredded.slugifier.call(input.to_s)
end
|
#public? ⇒ Boolean
64
65
66
|
# File 'app/models/thredded/private_topic.rb', line 64
def public?
false
end
|
#should_generate_new_friendly_id? ⇒ Boolean
68
69
70
|
# File 'app/models/thredded/private_topic.rb', line 68
def should_generate_new_friendly_id?
title_changed?
end
|