興味本位で書き直してみました
Model.joins{other_model}.uniq
(これにより生成されます):
=> "SELECT DISTINCT [model].* FROM [model] INNER JOIN [other_model] ON [other_model].[model_id] = [model].[id]"
純粋なSqueelでは、しかし、私が得ることができる最も近いものは
Model.joins{other_model}.select{distinct(id)}
生成するもの:
=> "SELECT DISTINCT [model].[id] FROM [model] INNER JOIN [other_model] ON [other_model].[model_id] = [model].[id]"
DISTINCT [model].*
Squeel ではどうすればよいですか? 出来ますか?
ありがとう