Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def assign_category(cat, skills = [], outcomes = [], tags = [])
- skills.each do |id|
- PrimitiveCategory.where(category_id: cat.id,
- skill_id: id,
- primitive_type: "skill").first_or_create
- end
- outcomes.each do |id|
- PrimitiveCategory.where(category_id: cat.id,
- outcome_id: id,
- primitive_type: "outcome").first_or_create
- end
- tags.each do |id|
- PrimitiveCategory.where(category_id: cat.id,
- tag_id: id,
- primitive_type: "tag").first_or_create
- end
- end
- comp_id = 47
- deep_discovery = Category
- .where(
- {name: "Deep Discovery",
- uid: "deep_discovery"}).first_or_create
- skill_ids = [540]
- assign_category(deep_discovery, skill_ids)
- close_attempt = Category
- .where(
- {name: "Close Attempts",
- uid: "close_attempt"}).first_or_create
- skill_ids = [12, 79, 68, 379, 436, 437, 455, 456, 474, 475, 541, 608]
- assign_category(close_attempt, skill_ids)
- surface_discovery = Category
- .where(
- {name: "Surface Discovery",
- uid: "surface_discovery"}).first_or_create
- skill_ids = [332, 327, 411, 431, 432, 450, 451, 469, 470, 550, 551, 563, 564, 572, 539, 540, 611]
- assign_category(surface_discovery, skill_ids)
- pitch = Category
- .where(
- {name: "Pitches",
- uid: "pitch"}).first_or_create
- skill_ids = [73, 307, 335, 339, 363, 365, 364, 327, 368, 366, 412, 413, 433, 434, 435, 452, 453, 454, 471, 472, 548, 552, 553, 544, 602]
- assign_category(pitch, skill_ids)
- objection = Category
- .where(
- {name: "Objections",
- uid: "objection"}).first_or_create
- skill_ids = [278, 346, 348, 349, 350, 351, 352, 353, 354, 362, 318, 319, 321, 322, 323, 320, 347, 494, 495, 496, 497, 498, 507, 508, 509, 510, 511, 520, 521, 522, 523, 569, 570, 524, 586, 587, 588, 589, 590, 568, 597, 598, 599, 600, 601, 617, 638]
- assign_category(objection, skill_ids)
Add Comment
Please, Sign In to add comment