Fix arel query.