Instantly share code, notes, and snippets.

@bholzer /thing.rb
Last active Nov 16, 2017

Embed
What would you like to do?
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