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

boolean_map #258

Closed
lfender6445 opened this issue Apr 2, 2014 · 2 comments
Closed

boolean_map #258

lfender6445 opened this issue Apr 2, 2014 · 2 comments

Comments

@lfender6445
Copy link
Contributor

From the README:

YupNopeBooleans = Virtus.model { |mod|
  mod.coerce = true
  mod.string.boolean_map = { 'yup' => true, 'nope' => false }
}

I would get undefined method string for Virtus::Configuration...

But I managed to get it working by going deeper on the object.

mod.coercer.config.string.boolean_map = { 'yup' => true, 'nope' => false }

Is there a mistake in the readme or am I missing something?

@solnic
Copy link
Owner

solnic commented Apr 2, 2014

That's an error in the readme ;(

On Wed, Apr 2, 2014 at 9:21 PM, Luke Fender notifications@github.com
wrote:

From the readme:

YupNopeBooleans = Virtus.model { |mod|
  mod.coerce = true
  mod.string.boolean_map = { 'yup' => true, 'nope' => false }
}

I would get undefined method string for Virtus::Configuration...
But I managed to get it working by going deeper on the object.

mod.coercer.config.string.boolean_map = { 'yup' => true, 'nope' => false }

Is this intentional?

Reply to this email directly or view it on GitHub:
#258

@lfender6445
Copy link
Contributor Author

#259

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