How do I write a Rails finder method where none of the has_many items has a non-nil field?

First of all, this really depends on whether or not you want to use a pure Arel approach or if using SQL is fine. The former is IMO only advisable if you intend to build a library but unnecessary if you're building an app where, in reality, it's highly unlikely that you're changing your DBMS along the way (and if you do, changing a handful of manual queries will probably be the least of your troubles).

Assuming using SQL is fine, the simplest solution that should work across pretty much all databases is this:

Order.where("(SELECT COUNT(*) FROM line_items WHERE line_items.order_id = orders.id AND line_items.discount_applied IS NULL) = 0")

This should also work pretty much everywhere (and has a bit more Arel and less manual SQL):

Order.left_joins(:line_items).where(line_items: { discount_applied: nil }).group("orders.id").having("COUNT(line_items.id) = 0")

Depending on your specific DBMS (more specifically: its respective query optimizer), one or the other might be more performant.

Hope that helps.