Skip to content

Instantly share code, notes, and snippets.

@scrogson
Created May 3, 2015 22:35
Show Gist options
  • Save scrogson/312719927c7d0b008068 to your computer and use it in GitHub Desktop.
Save scrogson/312719927c7d0b008068 to your computer and use it in GitHub Desktop.
def event_map do
Enum.reduce Repo.all(Event), %{}, fn event, acc ->
Map.put(acc, event.id, event.name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment