How should I model a nested comment thread?

Hi I’m implementing a forum with nested post threads (reddit style)
threads and comments can be voted on. threads can be tagged threads have
titles, comment don’t my views will usually need to generate only a
subset of 3 levels of the whole comment tree.
i’m wondering if I should create a separate and table model for threads,
or use only table where root = 0 if it’s a thread record
in the latter option i’m thinking of creating a tabless model which will
represent a thread (the id will be the id of the root comment
what will be the easiest way to implement it ?

Edit :

this is what i’m thinking about the second option. what relations should
thread and post have ? should thread be a resource?

class Thread
include ActiveModel::Validations

attr_accessor :root_post_id, :depth
end

class Post < ActiveRecord::Base
belongs_to :user
belongs_to :post
#belongs_to :thread ???

acts_as_tree

acts_as_taggable_on :topics
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs