menu_products = JSON.parse( MenuMealsDish
.joins( menu_products: [ :children_category, :product ] )
.select( 'menu_products.count_fact',
'products.code AS product_code',
'children_categories.code AS category_code' )
.where( menu_requirement_id: menu_requirement_id )
.where( 'menu_products.count_fact != ? ', 0 )
.to_json, symbolize_names: true )
child = { b: BigDecimal.new('12.34'), s: 'string' }.to_json
main = { main: 'testing' }.merge!( child: child )
puts main
# {:main=>"testing", :child=>"{\"b\":\"0.1234E2\",\"s\":\"string\"}"}