Class: SimpleForum::Forum
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SimpleForum::Forum
- Defined in:
- app/models/simple_forum/forum.rb
Instance Method Summary collapse
- #moderated_by?(user) ⇒ Boolean (also: #is_moderator?)
- #to_param ⇒ Object
Instance Method Details
#moderated_by?(user) ⇒ Boolean Also known as: is_moderator?
45 46 47 48 49 50 51 52 53 |
# File 'app/models/simple_forum/forum.rb', line 45 def moderated_by?(user) return false unless user @moderated_by_cache ||= {} if @moderated_by_cache.has_key?(user.id) @moderated_by_cache[user.id] else @moderated_by_cache[user.id] = moderators.include?(user) end end |
#to_param ⇒ Object
40 41 42 |
# File 'app/models/simple_forum/forum.rb', line 40 def to_param "#{id}-#{name.to_s.parameterize}" end |