Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

NoMethodError: undefined method `to_money' for nil:NilClass #35

Closed
palexvs opened this Issue · 5 comments

3 participants

@palexvs

this code:
transaction.update_attributes(amount: nil)
rise error:
NoMethodError: undefined method `to_money' for nil:NilClass

this is not real problem, but it perhaps should be handle

Thank you

@alup
Owner

This is handled by the :allow_nil option of monetize macro. This is not well documented :S. Will do in next days

@palexvs

Yes, i see
But why it rise error not return 'false' and error message if get nil

@alup
Owner

Yes, you are right. It should return false and the corresponding error message. And I think this is not a trivial fix.

@alup
Owner

@palexvs The NoMethodError has been fixed, the problem is that I should find a way to return false.

@semmons99
Owner

no activity, closing

@semmons99 semmons99 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.