summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-09-06 11:54:58 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2019-09-07 06:43:17 +0200
commitf2754e416e16c1b56810b835505346c295578c7a (patch)
tree42867740b585563f6569e5b9a46071c67466e5bc /spec
parent093858adc76f893c35b0bcf25127c3f229a7bcb6 (diff)
downloadgitlab-ce-f2754e416e16c1b56810b835505346c295578c7a.tar.gz
Use delete_all for deleting eventsevents-delete-all
Because we don't have any destroy callbacks (or other logic triggered on event destroy), there is no reason for deleting events inefficiently one by one, instead we can use :delete_all.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index b8c323904b8..6722a3c627d 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -32,7 +32,7 @@ describe User do
it { is_expected.to have_many(:groups) }
it { is_expected.to have_many(:keys).dependent(:destroy) }
it { is_expected.to have_many(:deploy_keys).dependent(:nullify) }
- it { is_expected.to have_many(:events).dependent(:destroy) }
+ it { is_expected.to have_many(:events).dependent(:delete_all) }
it { is_expected.to have_many(:issues).dependent(:destroy) }
it { is_expected.to have_many(:notes).dependent(:destroy) }
it { is_expected.to have_many(:merge_requests).dependent(:destroy) }