Reading nil attribute would throw an exception, because of attr.to_sym
Rails default behavior will accept nil attributes when reading a value because it's first converted as a string
This is also the case when dirty attributes are cleared, clear_attribute_change callers such as increment! / touch will first convert the attribute to a string
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.04%) to 94.598% when pulling ea2614dbaf2617e913961b55a5139da6bbe887f9 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.05%) to 94.611% when pulling f7beba70a456dc5b207d14e9d9ad6d929ed28513 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Coverage increased (+0.05%) to 94.611% when pulling f7beba70a456dc5b207d14e9d9ad6d929ed28513 on Edouard-chin:allow-nil-attribute into 3ec26f4d2ab602f80da00dc663685c16e71f1d01 on byroot:master.
Reading
nil
attribute would throw an exception, because ofattr.to_sym
nil
attributes when reading a value because it's first converted as a stringclear_attribute_change
callers such asincrement!
/touch
will first convert the attribute to a stringcc/ @rafaelfranca