rubyforgood / pet-rescue

Pet Rescue is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.
MIT License
57 stars 95 forks source link

Refactor Answer to CustomForm::SubmittedAnswer #833

Closed kasugaijin closed 1 month ago

kasugaijin commented 2 months ago

Answer should be renamed to CustomForm::SubmittedAnswer. This means renaming all areas in the app (table (answers), model, controller, policies, views, tests, variables, methods etc.). It should be a relatively straightforward find and replace.

Note the table should be renamed to submitted_answers_table. The CustomForm scope helps to organize this resource along with others that are similar.

please nest the classes instead of inline: https://thoughtbot.com/blog/why-you-should-nest-modules-in-ruby we are trying to move to the nested format throughout.

Any questions - comment below!

sarvaiyanidhi commented 2 months ago

Hi @kasugaijin I can take up this issue. Can you please assign it to me? Thanks

sarvaiyanidhi commented 2 months ago

Hi @kasugaijin ,

I see that you have mentioned above to rename model Answer to CustomForm::Answer but you have mentioned table to be renamed from answers_table to submitted_answers_table so just want to confirm we don't want to name model as CustomForm::SubmittedAnswer to follow standard with table name?

Thanks, Nidhi

sarvaiyanidhi commented 2 months ago

Hi @kasugaijin ,

I see that you have mentioned above to rename model Answer to CustomForm::Answer but you have mentioned table to be renamed from answers_table to submitted_answers_table so just want to confirm we don't want to name model as CustomForm::SubmittedAnswer to follow standard with table name?

Thanks, Nidhi

I think we need CustomForm::SubmittedAnswer only as per title of the issue.. I got confused with description mentioning CustomForm::Answer. Will go ahead and create PR accordingly.

kasugaijin commented 2 months ago

Yes my bad! Thank you for flagging this. It should be CustomForm::SubmittedAnswer