rubyforgood / casa

Volunteer management system for nonprofit CASA, which serves foster youth in counties across America.
https://casavolunteertracking.org/
MIT License
314 stars 478 forks source link

Bug: "Youth's Date in Care" being deleted when new case is created #5291

Closed bcastillo32 closed 1 year ago

bcastillo32 commented 1 year ago

Impacted User Types

Environment

desktop

Current Behavior

When a new case is created, "Youth's Date in Care" entered is deleted.

Before Clicking "+Create CASA Case" (submitting form)

image



After - "Edit Case Details"

image

Expected Behavior

When a New CASA Case is created, all info submitted is saved

How to Replicate

ex:

  1. Log in as an admin.
  2. Click on "Cases" in the left sidebar menu.
  3. Click "+New Case"
  4. Fill out Form details including "Youth's Date in Care"
  5. Submit form - click "+Create CASA Case"
  6. Click "Edit Case Details" and notice "Youth's Date in Care" is missing

How to access the QA site

Login Details:
Link to QA site

Login Emails:

password for all users: 12345678

Questions? Join Slack!

We highly recommend that you join us in slack https://rubyforgood.herokuapp.com/ #casa channel to ask questions quickly and hear about office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.

mattzollinhofer commented 1 year ago

I can take a look at this issue.

mattzollinhofer commented 1 year ago

After an initial look, it appears that date_in_care is not part of permitted params and so the date is not making its way into the CasaCase creation.

  def casa_case_params
    params.require(:casa_case).permit(
      :case_number,
      :birth_month_year_youth,
      :court_report_due_date,
      :empty_court_date,
      casa_case_contact_types_attributes: [:contact_type_id],
      court_dates_attributes: [:date]
    )
  end
schoork commented 1 year ago

@mattzollinhofer Can you start with an initially failing test and then make the changes to fix it?

mattzollinhofer commented 1 year ago

@mattzollinhofer Can you start with an initially failing test and then make the changes to fix it?

Ha, sorry -- I was just taking notes while I wasn't assigned to the issue. I'll certainly get specs around this and get an PR out.