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
Setting bucket properties is goofy #148
Conversation
it 'works like a hash' do
expect(props['r']).to eq 'quorum'
expect{ props['r'] = 1 }.to_not raise_error
expect{ props.store }.to_not raise_error
props.reload
expect(props['r']).to eq 1
end
it 'works like with accessor methods' do
expect(props.r).to eq 'quorum'
expect{ props.r = 1 }.to_not raise_error
expect{ props.store }.to_not raise_error
props.reload
expect(props.r).to eq 1
end |
TODO: test it with composite/hash properties like the modfun above. |
require 'riak/client/beefcake/crdt_operator' | ||
require 'riak/client/beefcake/crdt_loader' | ||
require 'riak/client/beefcake/protocol' | ||
require 'riak/client/beefcake/socket' | ||
true | ||
rescue LoadError, NameError | ||
rescue LoadError, NameError => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby-n00b question: why set e
when it's unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I so the exception goes into a variable and I can find it in a debugger. I should probably roll that one back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation.
@bkerley this all looks great and is very easy to follow. |
+1 3257730 |
Setting bucket properties is goofy Reviewed-by: drewkerrigan
@borshop merge |
Developers want to do this:
What happens is this fetches the props hash from Riak, and then mutates that has in place. At no time is it saved to Riak.
Doing this should save it:
But it's terribly unintuitive.