Skip to content

Conversation

@charliecreates
Copy link

Context

Sentry issue RECIPIN-5 (linked from Linear REC-10) raised NoMethodError: undefined method 'each' for nil originating from Recipe#update_metadata when instruction_sections= was called with nil.

Changes

  • Updated Recipe#update_metadata to strip out nil values from extractor data and convert a nil instruction_sections value to an empty array before delegating to assign_attributes.
  • Added an explanatory inline comment for future maintainers.
  • Added unit test to ensure saving a recipe when the extractor returns instruction_sections: nil does not raise and results in an empty association.

Verification

bundle exec rake test

All tests (existing + new) pass locally.

Closes REC-10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants