Class: Moxie::Topic

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/moxie/topic.rb

Instance Method Summary collapse

Instance Method Details

#decrement_forum_topic_countObject



28
29
30
31
# File 'app/models/moxie/topic.rb', line 28

def decrement_forum_topic_count
  forum.topic_count -= 1
  forum.save      
end

#increment_forum_topic_countObject



23
24
25
26
# File 'app/models/moxie/topic.rb', line 23

def increment_forum_topic_count
  forum.topic_count += 1
  forum.save
end

#remove_postsObject



33
34
35
# File 'app/models/moxie/topic.rb', line 33

def remove_posts
  posts.each { |p| p.destroy }
end