|
316 | 316 | HTML |
317 | 317 | end |
318 | 318 |
|
| 319 | +# Seed the "CE hours" details — the continuing-education requirements, payment, |
| 320 | +# and sign-in rules that used to live in a long CE confirmation email. Shown on its |
| 321 | +# own ticket-linked page (and via the prominent indigo call-out on the ticket) for |
| 322 | +# registrants who requested CE credit. A custom label demonstrates that the heading |
| 323 | +# is admin-editable. Only set when blank so admin edits survive a re-seed. |
| 324 | +if flagship && flagship.ce_hours_details.blank? |
| 325 | + flagship.update!(ce_hours_details_label: "Continuing education", ce_hours_details: <<~HTML.strip) |
| 326 | + <p>This training is approved by the California Association of Marriage and Family Therapists (CAMFT, provider #000000) for <strong>12 CE hours</strong>. AWBW is approved to sponsor continuing education for LMFTs, LCSWs, LPCCs, and LEPs.</p> |
| 327 | + <h3>Before the training</h3> |
| 328 | + <ul> |
| 329 | + <li>Provide your license type and license number when you register — we cannot issue a CE certificate without it.</li> |
| 330 | + <li>CE hours carry a separate $25 processing fee, payable with your registration.</li> |
| 331 | + </ul> |
| 332 | + <h3>During the training</h3> |
| 333 | + <ul> |
| 334 | + <li>You must sign in and out each day. CE hours are awarded only for full attendance — partial credit is not available.</li> |
| 335 | + <li>Arrive on time; late arrivals or early departures may forfeit CE eligibility.</li> |
| 336 | + </ul> |
| 337 | + <h3>After the training</h3> |
| 338 | + <ul> |
| 339 | + <li>Complete the post-training evaluation within one week.</li> |
| 340 | + <li>Your CE certificate will be emailed within three weeks of the training.</li> |
| 341 | + </ul> |
| 342 | + <p>Questions about continuing education? Reach out and our team will follow up with details.</p> |
| 343 | + HTML |
| 344 | +end |
| 345 | + |
| 346 | +# The trauma-informed training also offers CE hours, with the default label. |
| 347 | +trauma = Event.find_by(title: "Facilitator Training: Trauma-Informed Art Practices") |
| 348 | +if trauma && trauma.ce_hours_details.blank? |
| 349 | + trauma.update!(ce_hours_details: <<~HTML.strip) |
| 350 | + <p>This training is approved by CAMFT (provider #000000) for <strong>18 CE hours</strong> across its three days.</p> |
| 351 | + <ul> |
| 352 | + <li>Provide your license type and number at registration; a $25 CE processing fee applies.</li> |
| 353 | + <li>Daily sign-in/sign-out is required — CE hours are awarded for full attendance only.</li> |
| 354 | + <li>Complete the post-training evaluation to receive your certificate within three weeks.</li> |
| 355 | + </ul> |
| 356 | + HTML |
| 357 | +end |
| 358 | + |
319 | 359 | puts "Creating Event Registrations…" |
320 | 360 |
|
321 | 361 | # Key people for named scenarios |
|
384 | 424 | # Kim Davis: cancelled (has user) |
385 | 425 | if facilitator_training |
386 | 426 | [ |
387 | | - { person: amy_person, status: "registered", scholarship_requested: true }, |
388 | | - { person: maria_j, status: "registered" }, |
389 | | - { person: anna_g, status: "attended" }, |
| 427 | + { person: amy_person, status: "registered", scholarship_requested: true, ce_credit_requested: true }, |
| 428 | + { person: maria_j, status: "registered", ce_credit_requested: true }, |
| 429 | + { person: anna_g, status: "attended", ce_credit_requested: true }, |
390 | 430 | { person: mario_j, status: "registered" }, |
391 | 431 | { person: kim_d, status: "cancelled" } |
392 | 432 | ].each do |data| |
|
402 | 442 | # Linda Williams: no_show (no user) |
403 | 443 | if trauma_training |
404 | 444 | [ |
405 | | - { person: sarah_s, status: "registered" }, |
406 | | - { person: jessica_b, status: "registered", scholarship_requested: true }, |
| 445 | + { person: sarah_s, status: "registered", ce_credit_requested: true }, |
| 446 | + { person: jessica_b, status: "registered", scholarship_requested: true, ce_credit_requested: true }, |
407 | 447 | { person: angel_g, status: "registered" }, |
408 | 448 | { person: linda_w, status: "no_show" } |
409 | 449 | ].each do |data| |
|
461 | 501 | # Create all registrations |
462 | 502 | registrations_data.each do |data| |
463 | 503 | next unless data[:event] && data[:person] |
464 | | - next if EventRegistration.exists?(event: data[:event], registrant: data[:person]) |
465 | 504 |
|
466 | | - EventRegistration.create!( |
467 | | - event: data[:event], |
468 | | - registrant: data[:person], |
469 | | - status: data[:status] || "registered", |
470 | | - scholarship_requested: data[:scholarship_requested] || false |
471 | | - ) |
| 505 | + registration = EventRegistration.find_or_initialize_by(event: data[:event], registrant: data[:person]) |
| 506 | + registration.status = data[:status] || "registered" if registration.new_record? |
| 507 | + registration.scholarship_requested ||= data[:scholarship_requested] || false |
| 508 | + # Keep the CE flag in sync on re-seed so the named CE scenarios survive an |
| 509 | + # existing DB (the find_or_initialize guard above no longer recreates them). |
| 510 | + registration.ce_credit_requested = data[:ce_credit_requested] || false |
| 511 | + registration.save! |
472 | 512 | end |
473 | 513 |
|
474 | 514 | # Give the flagship training its demo cohort: top up to 10 active registrants with |
|
0 commit comments