Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish sane default for nil conversions #8

Open
lovehandle opened this issue Aug 30, 2013 · 1 comment
Open

Establish sane default for nil conversions #8

lovehandle opened this issue Aug 30, 2013 · 1 comment

Comments

@lovehandle
Copy link

When I was in the process of porting Virtus over to RubyMotion, I noticed a peculiarity that I hadn't noticed in previous versions where one could no longer instantiate an object without passing in attributes as well.

E.G.

class User
  include Virtus
  attribute :name, String
end

User.new #=> UnsupportedCoercion: Object#to_string doesn't know how to coerce nil.

The issue arose with the addition of this line of code. The line previously looked like this.

I don't mind handling this one if you give me a strategy. Implement a NilClass coercer that returns value for every coercion method?

@Jesterovskiy
Copy link

Same for me. Nothing changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants