| Issue 4: | 資料庫關聯的處理 | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
不知道現在打算怎麼處理資料庫關聯的方式? 目前 find_all , find 都只能處理單一資料表. 不過實際上操作常常會需要用到 left join 或是 inner join ... |
||||||||||
,
Feb 24, 2008
基本上是可以這樣寫的:
[code]
find_all("stores left join user on user.store_id = store.id") // 鮮少使用Join.. 不
知道語法是否正確
[/code]
Status: Accepted
|
|||||||||||
,
Feb 24, 2008
不過這樣寫的話,整體的語法又變得很複雜。
看樣子得思索一下該如何加進去會比較清楚好看...
像是 {'inner'=>{'關聯表格'=>'條件'}} 這類的...
|
|||||||||||
|
|
|||||||||||