Branch: refs/heads/master
Home: https://github.com/openSUSE/open-build-service
Commit: 2aa70f15d906685432f6d21566321d21e922b864
https://github.com/openSUSE/open-build-service/commit/2aa70f15d906685432f6d2...
Author: Lukas Krause
Date: 2023-09-07 (Thu, 07 Sep 2023)
Changed paths:
M src/api/app/models/user.rb
Log Message:
-----------
Use `destroy_all` over `delete_all` in `mark_as_spammer` method
Currently when we mark a user as spammer we delete the comments
associated with the user using `delete_all`.
But this doesn't instantiate the comments first, so it doesn't
delete the notification that are assoicated with the comments.
We have set the `dependent: :destroy` on the `has_many :comments`
on the user model, which defaults to `:delete_all` on a
collection proxy, which doesn't call the `destroy` method on the
comment. Therefore we have to use the `destroy_all` method.
See: https://api.rubyonrails.org/v7.0.7.2/classes/ActiveRecord/Associations/Colle...
Fixes #14874
Commit: ce68e1f9a765129b27332d2d3e0b418b653ac7cb
https://github.com/openSUSE/open-build-service/commit/ce68e1f9a765129b27332d...
Author: Dani Donisa
Date: 2023-09-08 (Fri, 08 Sep 2023)
Changed paths:
M src/api/app/models/user.rb
Log Message:
-----------
Merge pull request #14882 from krauselukas/fix/mark_as_spammer
Use `destroy_all` over `delete_all` in `mark_as_spammer` method
Compare: https://github.com/openSUSE/open-build-service/compare/be43f75f8af5...ce68e1...