remove unused `#generalized_table`

This method wass copied from journey at https://github.com/rails/rails/commit/56fee39c392788314c44a575b3fd66e16a50c8b5#diff-d89de8881fc4b9f10cb3e4fc7b2463f3R53. However it looks the method was unused in journey at those point as well.
remove unused `#optional_parts`

This method was copied from journey at https://github.com/rails/rails/commit/56fee39c392788314c44a575b3fd66e16a50c8b5#diff-2cfaf53c860732fea8689d6f2002594bR78.
`grep -nr 'optional_parts' .`
Merge pull request #17930 from sergey-alekseev/remove-unused-generalized-table

remove unused `#generalized_table` and `#optional_parts`