Collecting hashes into OpenStruct creates “table” entry

前端 未结 6 883
滥情空心
滥情空心 2021-02-04 05:46

Why this (evaluated in Rails console)

[{:a => :b}].collect {|x| OpenStruct.new(x)}.to_json

adds a \"table\" record in there?



        
6条回答
提交回复
热议问题