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

exactly_one_of wrapped inside a Hash doesn't work #842

Closed
nbphuoc opened this issue Dec 8, 2014 · 4 comments
Closed

exactly_one_of wrapped inside a Hash doesn't work #842

nbphuoc opened this issue Dec 8, 2014 · 4 comments
Labels

Comments

@nbphuoc
Copy link

nbphuoc commented Dec 8, 2014

the exactly_one_of method doesn't work correctly if it is wrapped inside a Hash

@dblock
Copy link
Member

dblock commented Dec 8, 2014

Would be helpful if you could write an RSpec test that reproduces this problem.

@dblock dblock added the bug? label Dec 8, 2014
@tamvm
Copy link

tamvm commented Dec 15, 2014

+1 not work, here is one of example:

        requires :order, type: Hash do
          optional :quantity, type: BigDecimal
          optional :usd_amount, type: BigDecimal
          exactly_one_of :quantity, :usd_amount
        end

Rspec for it

post "/api/v1/orders", {order: {quantity: 1}}
expect(response).to have_http_status(200)

@dblock
Copy link
Member

dblock commented Dec 15, 2014

This is fixed on HEAD, in #774. Confirmed with the spec above.

@dblock dblock closed this as completed Dec 15, 2014
@tamvm
Copy link

tamvm commented Dec 15, 2014

Thanks for your contribution @dblock, , haven't had chance to check it, because I just use head of master and it raised this issue #825

Will check again later.

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

No branches or pull requests

3 participants