2011-04-07 73 views
0

有沒有辦法將MATCHAGAINST零件轉換爲Arel如何將SQL轉換爲Arel?

我在Arel源代碼中找不到任何關於它的東西。

我用Rails 3

SELECT gigs.time, gigs.channel_id, gigs.song_id, gigs.id, 
    MATCH (songs.title) AGAINST (?) AS song_score, 
    MATCH (artists.name) AGAINST (?) AS artist_score 
    FROM songs 
    INNER JOIN artists ON artists.id = songs.artist_id 
    INNER JOIN gigs ON gigs.song_id = songs.id 
    WHERE MATCH (artists.name) AGAINST (?) OR 
    MATCH (songs.title) AGAINST (?) 
    HAVING (artist_score + song_score) > 0 

回答

1

AFAIK沒有阿雷爾MATCH AGAINST實現。我的猜測是因爲它不是純SQL,而是針對MySQL。

+0

好點,謝謝! – Oleander 2011-04-07 21:34:40