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

obfuscate does not work with lambda #24

Closed
belt-ascendlearning opened this issue Dec 4, 2015 · 12 comments · Fixed by #25
Closed

obfuscate does not work with lambda #24

belt-ascendlearning opened this issue Dec 4, 2015 · 12 comments · Fixed by #25

Comments

@belt-ascendlearning
Copy link

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)>}"]
@nettofarah
Copy link
Contributor

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?

@belt-ascendlearning
Copy link
Author

Yes.

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

@nettofarah
Copy link
Contributor

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

@nettofarah
Copy link
Contributor

@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

@belt-ascendlearning
Copy link
Author

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

@nettofarah
Copy link
Contributor

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

@nettofarah
Copy link
Contributor

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

Thank you for catching this!
cc @compwron

@nettofarah
Copy link
Contributor

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.

@nettofarah
Copy link
Contributor

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

@belt-ascendlearning
Copy link
Author

Confirmed. Thank you verily.

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

@nettofarah
Copy link
Contributor

thank you!

@compwron
Copy link
Contributor

compwron commented Dec 8, 2015

Oops. Sorry about that.

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

Successfully merging a pull request may close this issue.

3 participants