Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. UserActivityAnswers.where(activity_id: 32).each do |uaa| #asian food 1
  2. dish = uaa.answers["questions"].second
  3. unless dish["text"]["en"].nil?
  4. dish["text"]["en"] = "Dish 2"
  5. dish["questions"].first["text"]["en"] = "Beef with rice noodles"
  6. uaa.answers["questions"] << dish
  7. dish["text"]["en"] = "Dish 3"
  8. dish["questions"].first["text"]["en"] = "Spring rolls and dim sum"
  9. uaa.answers["questions"] << dish
  10. uaa.save!
  11. end
  12. end
  13.  
  14. UserActivityAnswers.where(activity_id: 28).each do |uaa| #asian food 2
  15. unless dish["text"]["en"].nil?
  16. dish = uaa.answers["questions"].second
  17. dish["text"]["en"] = "Dish 2"
  18. dish["questions"].first["text"]["en"] = "Banana Fritter"
  19. uaa.answers["questions"] << dish
  20. dish["text"]["en"] = "Dish 3"
  21. dish["questions"].first["text"]["en"] = "San Choy Bao"
  22. uaa.answers["questions"] << dish
  23. uaa.save!
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement