phlex-ruby / phlex

A framework for building object-oriented views in Ruby.
https://beta.phlex.fun
MIT License
1.3k stars 84 forks source link

Fix `mix` to accept old or new nil values #780

Closed davekaro closed 2 months ago

davekaro commented 2 months ago

Fixes https://github.com/phlex-ruby/phlex/issues/779, but ~I don't think it's all the way there because it only handles the [String, nil] combo~. I don't know the reasons the code changed for mix so much in https://github.com/phlex-ruby/phlex/commit/0f8d8cbc6b919a4749674a6f68d7b426f5d97ecc#diff-1379affdd94a5363d3331840af91bc6171dac9338b2f6bd886a0636ac6258a38, so this is more a starting point.

Update: in the second commit I made it work for the other types, but I'm sure there are other approaches to consider.