使用Ruby-on-Rails,我想存储一个由3个元素组成的数组:帖子的最后3条 comments .我知道我可以将 comments 表加入到帖子1中,但是为了zoom 的目的,我会避免做这个繁重的请求.
So I was wondering what was the best way to store those 3 elements, as I would like to update them easily every time a new comment is made: remove the last comment and add the new one.
What is the correct way to do this ? Store it in a serialized array or in a JSON object ?