My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 4: 資料庫關聯的處理
1 person starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  zusocfc
Cc:  darkhero
Type-Enhancement
Priority-Medium


Sign in to add a comment
 
Reported by darkhero, Feb 21, 2008
不知道現在打算怎麼處理資料庫關聯的方式?

目前 find_all , find 都只能處理單一資料表.
不過實際上操作常常會需要用到 left join 或是 inner join ...

Comment 1 by zusocfc, Feb 24, 2008
基本上是可以這樣寫的:
[code]
  find_all("stores left join user on user.store_id = store.id") // 鮮少使用Join.. 不
知道語法是否正確
[/code]
Status: Accepted
Comment 2 by darkhero, Feb 24, 2008
不過這樣寫的話,整體的語法又變得很複雜。
看樣子得思索一下該如何加進去會比較清楚好看...

像是 {'inner'=>{'關聯表格'=>'條件'}} 這類的...
Sign in to add a comment

Hosted by Google Code