Millions of schoolkids across California will be less likely to find themselves humiliated in front of classmates for owing money for school lunches.

California Gov. Gavin Newsom on Saturday signed into law a measure that stipulates that all students get lunch, regardless of whether their families are behind in paying meal fees. It also requires that pupils with lunch debt are "not shamed or treated differently."

The legislation requires that all public school students have a "state reimbursable" meal provided, "even if their parent or guardian has unpaid meal fees." It amends a previous act that required students with lunch debt be offered "alternative" meals.

Get Breaking News Delivered to Your Inbox

The governor credited an elementary school student in Napa Valley for calling attention to "how kids at his school were shamed and singled out because of inadequate funds in their school lunch accounts." Earlier this year, 9-year-old Ryan Kyote used his allowance savings to pay off his third-grade class's lunch debt after watching a student made to take back her hot lunch due to what her family owed.

"He showed how at many schools across the country, students whose parents are not able to pay for their lunch are given a cheaper, 'alternative' lunch that causes them to stick out from their peers," Newsom said in a statement.

The governor's move drew praise from talk show host Ellen DeGeneres, who labeled it as "incredible."

Still, the issue is also one drawing attention outside of California. After threatening foster care for children in arrears and initially refusing a businessman's offer to cover lunch debt, a Pennsylvania school district in July did an about-face, saying it would accept donations to cover the meal tabs after all.

In May, after a Rhode Island school district reversed its decision to start serving cold sandwiches instead of hot lunches to students whose families owe lunch money, Chobani CEO Hamdi Ulukaya offered to pay off their debts.

A Trump administration proposal to cut so-called loopholes in the federal food-stamp program could mean that almost 265,000 children may no longer qualify for free lunch.

Three-quarters of school districts had unpaid student meal debt at the end of the 2016-17 school year, a survey by the School Nutrition Association found. Of the districts with unpaid debt, 40% reported an increase in students without sufficient funds to pay for school meals.