irb(main):022:0> Requirement.filter(params['where']).sort(customer: {name: {asc: :nulls_last}}).distinct_on(:id)
Traceback (most recent call last):
ActiveRecord::StatementInvalid (PG::InvalidColumnReference: ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions)
LINE 1: SELECT DISTINCT ON ( "requirements"."id" ) "requirements".* ...