Skip to content

Instantly share code, notes, and snippets.

@bholzer
Last active November 16, 2017 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bholzer/2b62a9e8aac797d2a0b578231e9105d3 to your computer and use it in GitHub Desktop.
Save bholzer/2b62a9e8aac797d2a0b578231e9105d3 to your computer and use it in GitHub Desktop.
templates = Templates.all
mapped_things = pairs.map do |pair|
object = templates.find{|t| t.id == pair.second }
object = object.dup
object.thing_id = pair.first
object
end.compact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment