feat/add-popular-tasks#1708
feat/add-popular-tasks#1708floscodes wants to merge 21 commits intoloco-rs:feat/add-popular-tasksfrom
Conversation
…/loco into feat/add-popular-tasks
|
Hi @kaplanelad, I refactored the code and fixed the remaining issues. |
|
Hi @kaplanelad, is it ok like this? |
looks better. thanks. |
|
Hi @kaplanelad, just a quick heads-up: the CI is now passing and all tests are running successfully. Thank you! |
|
How group related to delete user task? |
|
The otherwise the test fails with the following error: That's why I had to add the this seems to be caused by the following test: |
|
From where the group came from? |
That also caught my attention 🙂 I didn’t intentionally introduce groups on my side. From what I could tell, the groups table is implicitly required by the ActiveModel::delete implementation. When the table is missing, the delete call fails at runtime, which is what caused the test to break. I traced this back to the CreateJoinTableUsersAndGroups migration generated in the test. That seems to be where the dependency comes from, even though groups itself isn’t created explicitly beforehand. The migration was added purely to make the test pass and avoid the runtime error — happy to change this if there’s a more intended approach 👍 |
|
Please clarify where the groups migration comes from specifically, explain that ActiveModelTrait::delete requires all related tables to exist. this is not clear to me Also, please remove the commented-out test code in new.rs not sure if why it commended |
|
Hi @kaplanelad, sorry for the delay. It looks like the tester.run_generate_migration(&vec!["CreateJoinTableUsersAndGroups", "count:int"]);Inside let base_command = vec!["loco", "generate", "migration"];and then extended with From what I can see, creating a user in the wizard task works without issues. However, when the user is deleted, the presence of the One possible explanation could also be related to how the ORM handles relations. Creating a user only inserts into the Please let me know if I might be misunderstanding something here. Best regards! |
This PR adds a user deletion functionality to popular tasks.