元のロジックはこちら
(scrape_datas = ScrapeData.find(
:all, :conditions =>
"artist_status = 'NOT_FOUND'
AND blacklisted = 1
AND extracted = 0
and not EXISTS(
SELECT * FROM artist_name_suggestions where original = artist_name
)
最初の部分をうまく分割できました
scrape_datas = ScrapeData.where(
:artist_status => 'NOT_FOUND',
:blacklisted => 1,
:extracted => 0
)
「and not EXISTS」クエリをミックスに入れるのに問題がありますが
and not EXISTS(
SELECT * FROM artist_name_suggestions where original = artist_name
)
ありがとう!