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.
72
73
74
75
76
|
# File 'app/models/thredded/private_topic.rb', line 72
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
86
87
88
|
# File 'app/models/thredded/private_topic.rb', line 86
def normalize_friendly_id(input)
Thredded.slugifier.call(input.to_s)
end
|
#public? ⇒ Boolean
78
79
80
|
# File 'app/models/thredded/private_topic.rb', line 78
def public?
false
end
|
#should_generate_new_friendly_id? ⇒ Boolean
82
83
84
|
# File 'app/models/thredded/private_topic.rb', line 82
def should_generate_new_friendly_id?
title_changed?
end
|