Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
palexvs opened this Issue Sep 10, 2012 · 5 comments

Comments

Projects
None yet
3 participants

palexvs commented Sep 10, 2012

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

Owner

alup commented Sep 10, 2012

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

palexvs commented Sep 10, 2012

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

Owner

alup commented Sep 10, 2012

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

Owner

alup commented Sep 23, 2012

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

Owner

semmons99 commented Nov 28, 2013

no activity, closing

@semmons99 semmons99 closed this Nov 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment