データベースから合計25の関連付けを取得しようとしています。15を1に等しいカウントにし、残りを1より大きいカウント(つまり、10より大きい)にします。私は以下を試しました:
def self.get_specific_array
a = Association.limit(25) # I would like a total of 25 associations
a.where(["count = ?", 1]).limit(15) # I would like 15 of the associations to have a count of 1
a.where(["count > ?", 1]) # I would like the remaining 10 associations to have a count that is greater then 1
a
end