Created
July 16, 2013 21:50
-
-
Save almaron/6015466 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_auth | |
| auths = {} | |
| self.authentications.each { |auth| auths[auth.provider] = auth.id } | |
| auths | |
| end |
Author
def get_auth
{}.tap{|t| self.authentications.each { |auth| t[auth.provider] = auth.id }}
end
self.authentications.inject({}) { |auths, auth| auths[auth.provider] = auth.id; auths }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need a way to shorten this to one line.