rails: best way to store comments in mysql
- by ciss
Hello.
Okay i have two models: posts and comments.
as you can think comments has column :post_id.
My models
Comments
belongs_to :post
Post
has_many :comments
So, this is pretty simple association but i have some problems with ordering comments.
at first time, when i create my comments migration file i just add column :position.
This column indicate comment position in the post.
But now i think what where is more good way to do this.
so i can't make my choise:
1) uses t.column :datatime :created_at, :default = Time.now()
2) or use timestamps? this is undiscovered for me, please tell me about your exp.