checkr / stasche

Stash + Cache = :moneybag:
Apache License 2.0
2 stars 2 forks source link

not able to set a key using `force: true` #24

Open joecabezas opened 6 years ago

joecabezas commented 6 years ago

what I am missing?

Stasche.set(joe_rules_backtest: 1, force: true)
Stasche::Store::KeyAlreadyExistsError: Key checkr-stasche:joe_rules_backtest already set in stasche. Use `force: true` to override.
from /bundle/gems/stasche-1.3.3/lib/stasche/store/s3.rb:26:in `set'
joecabezas commented 6 years ago

so it seems like in code: https://github.com/checkr/stasche/blob/5828241757ae7dde03cb3b56414c3e7c36e63cf3/lib/stasche/client.rb#L34-L40

both values, and options are positional arguments that both of them are expected to be hashes, this is why Stasche.set(joe_rules_backtest: 1, force: true) does nto work .and it needs to separate the arguments using brackets like:

Stasche.set({joe_rules_backtest: 1}, {force: true})

hope this is useful to anyone in the future, for now I added a spec to include this case:

related PR: https://github.com/checkr/stasche/pull/25