Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2016-09-02 23:29:47 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-09-06 18:14:09 +0300
commitea155ccc3edd071a0ca5adfd774513892b19ab6f (patch)
tree3e0e3811417a8bd818bf1ab9a6aafd4e6ea104d9 /spec/factories/notes.rb
parente9e8c67fb7d58288dbac1777b63ea7d3128d6268 (diff)
Optimize discussion notes resolving and unresolving
Use `update_all` to only require one query per discussion to update the notes resolved status. Some changes had to be made to the discussion spec to accout for the fact that notes are not individually updated now
Diffstat (limited to 'spec/factories/notes.rb')
-rw-r--r--spec/factories/notes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb
index 83e38095feb..6919002dedc 100644
--- a/spec/factories/notes.rb
+++ b/spec/factories/notes.rb
@@ -28,6 +28,11 @@ FactoryGirl.define do
diff_refs: noteable.diff_refs
)
end
+
+ trait :resolved do
+ resolved_at { Time.now }
+ resolved_by { create(:user) }
+ end
end
factory :diff_note_on_commit, traits: [:on_commit], class: DiffNote do