Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. a = %{
  2. lead: %{
  3. id: nil,
  4. selections: [
  5. %{
  6. type: "lead_type",
  7. name: "lt",
  8. options: [
  9. %{
  10. "name": "white_glove",
  11. "value": "wg"
  12. },
  13. %{
  14. "name": "direct",
  15. "value": "dir"
  16. },
  17. %{
  18. "name": "valuation_office",
  19. "value": "vo"
  20. }
  21. ]
  22. }
  23. ]
  24. }
  25. }
  26.  
  27. IO.puts "A"
  28. IO.inspect a
  29.  
  30. b = %{
  31. lead: %{
  32. id: nil
  33. }
  34. }
  35.  
  36. IO.puts "B"
  37. IO.inspect b
  38.  
  39. selections = [
  40. %{
  41. type: "lead_type",
  42. name: "lt",
  43. options: [
  44. %{
  45. "name": "white_glove",
  46. "value": "wg"
  47. },
  48. %{
  49. "name": "direct",
  50. "value": "dir"
  51. },
  52. %{
  53. "name": "valuation_office",
  54. "value": "vo"
  55. }
  56. ]
  57. }
  58. ]
  59.  
  60. IO.puts ""
  61.  
  62. b = Map.put(b.lead, :selections, selections)
  63.  
  64. #put_in(b, [:selections], selection)
  65. # lead = Map.put_new(b.lead, :selections, selections)
  66.  
  67. IO.puts "NEW B"
  68. IO.inspect b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement