Closed miloshadzic closed 9 years ago
I'm not sure if this is intended or not but:
class A include Virtus.value_object attribute :val, Symbol, default: :something end # case 1 A.new.val # => :something # case 2 A.new(val: nil).val # => nil
I would expect case 2 to return the default value as well.
Yes this is intended as you explicitly set the value to nil. Defaults are only set when no value was passed in.
I'm not sure if this is intended or not but:
I would expect case 2 to return the default value as well.