0
我想存儲數據庫架構下令數據庫中的數據支持了Rails 3,在這種情況下,表的內容表示視頻的部分:的Rails 3/SQL:有序分層(嵌套)數據
Section 1, 01:23
Section 1.1, 01:24
Section 1.2, 02:33
Section 2, 02:23
Section 2.1, 01:23
Section 2.1.1, 01:50
Section 2.2, , 01:55
我正要走近數據庫模式是這樣的:
section_id:int
parent_section:int (using a has_one relationship)
order:int (e.g. section 2.1 would be 0, section 2.2 would be 1 etc.)
video_id:int (links to a video)
length:int (length of this section of video)
兩個問題:1。 這是我可以用它來處理這個問題的最佳方案? 2. Rails 3是否有內置的處理這些數據的方式?
該嵌套集寶石做了詭計,只有一個我發現它適用於Rails 3 – bcoughlan 2011-03-15 22:05:50