What is the underlying code for TableA.create(TableB.all.map(&:attributes))? [duplicate]
问题 This question already has an answer here : What does map(&:name) do in this Ruby code? (1 answer) Closed 5 years ago . For example, if I use rename method in mongo ruby driver, I can check the code here What exactly is happening when I am using map(&:attributes)? I think this means tags.map(&:attributes.to_proc).join(' '), but I am not sure why I am getting "undefined method `each_pair' for Arrayxxxxx" error with this command: TableA.create(TableB.all.map(&:attributes)) Any insight will be