IFTTT/polo

obfuscate does not work with lambda

belt-ascendlearning opened this issue · 12 comments

def intersection(attrs, fields)
  attrs & fields.to_a.flatten.map(&:to_s)
end

fields.to_a.flatten.map(&:to_s) does not yield the array-of-strings you are looking for... instead it yields:

["{:password_digest => #20 < Proc:0x007fccdcb6abb0@RAILS_ROOT/lib/tasks/db_grep_associations.rake:92 (lambda)>}"]

hey @belt-ascendlearning, thank you for reporting the bug.
I think this was introduced here: #17

Are you running your script against our master branch?

Yes.

gem 'polo', github: 'IFTTT/polo/'

can you post the code you're trying to run? Including your Polo.configure block.

@belt-ascendlearning I just wrote a new test case for this, and it looks like the strategy works:
https://github.com/IFTTT/polo/blob/master/spec/translator_spec.rb#L40-L48

Polo.configure do
  obfuscate password_digest: -> {'changeme'}
end
Polo.explore(User, 1, [:roles])

Just managed to reproduce it!
I'll work on a fix.

Hi, @belt-ascendlearning.
Just fixed the bug with: #25.

Thank you for catching this!
cc @compwron

Btw, I just pushed a new version of Polo to rubygems.
You should be able to pull 0.2.0 and this should be fixed.

@belt-ascendlearning can you help us with our survey #19?

Confirmed. Thank you verily.

Survey completed... including a gist that others may find useful.

thank you!

Oops. Sorry about that.