Menu

Ruby Money vs nil — aka undefined method `round’ for nil:NilClass

Problem
When using composed_of with Money you get this nice error when trying to get the money object while the cents column is nil.
Additionally Money.new(nil) does not work, neither do strings like Money.new(params[:cents]).