How Do You Apply the Rational Basis Test to a Restoration of Prior Law?

I’m sure some people have thought a lot about this issue, and I hope they’ll bear with me as I pose an amateurish question: Should it matter to the constitutionality of Prop 8 that it was passed as part of a ballot initiative that restored preexisting law?

Here’s my thinking. Let’s say there’s a really old law on the books — say, a law that’s been around for 100 years. The legislature decides to repeal the law one day. To make matters interesting, let’s assume that there is a special interest group like a large corporation that lobbies the legislature to change the law to help its bottom line (making lots of campaign contributions along the way). But the repeal of the law turns out to be really unpopular with the voters. The next year, the voters decide they want the law back in place and they pass a ballot initiative restoring it. The law is later challenged on constitutional grounds, and a court is asked to determine if the law is supported by a rational basis.

Here’s the question: When determining whether the law is supported by a rational basis, is the right question whether the law that has been on the books for 100 years supported by a rational basis? Or is the question whether the public had a rational basis for restoring the law by passing the ballot initiative? Put another way, should courts assess the rationality of the law as an abstract matter, divorced from the context in which it was enacted? Or should they assess the rationality of the most recent passage of the law, including the context?

I ask because I can imagine that the public might have quite rational reasons for restoring prior law that are not reasons for supporting the original law. In the example above, for example, imagine the ballot initiative was passed as part of an anti-corruption campaign. Assume that proponents of the ballot initiative wanted the law restored to rebuff the corrupt legislators whose votes were bought by the special interests — potentially deterring them from future shenanigans. Voters expressed their dismay at the legislature by undoing their handiwork and restoring the status quo. Can that anti-corruption rationale provide a rational basis for the law that would be unavailable if the law had been challenged before the legislature repealed the law?

(I really don’t know — just askin’ questions.)