roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Refactor `AnswersController#create_or_update`

Open aaronskiba opened this issue 8 months ago • 1 comments

Changes proposed in this PR:

  • Refactor AnswerController#create_or_update
    • The majority of this refactor extracts logic from the create_or_update action into separate private helper methods (commits 609d5df3b8a66d1a2adc739a9b8fde038a3de72d, efecb337795f999de6679576cd3fd7ee0a5683f3, and a840abb1415e64888e51b1fdc268f550e8f1f4bb)
    • Commit 3534ee055e00be5f22d5c8702dcee8b68ec2de69 maintains the functional behaviour of the destruction of answers, but uses .destroy_all rather than iterating through each individual answer.
  • b40a04c92ee9a6dd4af4fcbeb47f9e4c2feca84b removes an unused variable from app/javascript/src/utils/sectionUpdate.js
  • b025dfe56de5fc23ad95667c5d487ccb515a4b73 addresses conflicting comments regarding the available locals variables available within app/views/answers/_new_edit.html.erb.

aaronskiba avatar Apr 29 '25 16:04 aaronskiba

1 Warning
:warning: There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior. \n
Ignore this warning if the PR ONLY contains translation.io synced updates.

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Apr 29 '25 16:04 github-actions[bot]