Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
8a1ee557
Commit
8a1ee557
authored
6 years ago
by
legton
Browse files
Options
Downloads
Patches
Plain Diff
SCRUM#364: Fix review average not updating after delete
parent
49fc92ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gemfile.lock
+1
-1
1 addition, 1 deletion
Gemfile.lock
app/models/review.rb
+2
-1
2 additions, 1 deletion
app/models/review.rb
with
3 additions
and
2 deletions
Gemfile.lock
+
1
−
1
View file @
8a1ee557
...
...
@@ -356,7 +356,7 @@ GEM
activemodel (= 5.0.0.1)
activerecord (= 5.0.0.1)
activesupport (= 5.0.0.1)
bundler (>= 1.3.0)
bundler (>= 1.3.0
, < 2.0
)
railties (= 5.0.0.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
...
...
This diff is collapsed.
Click to expand it.
app/models/review.rb
+
2
−
1
View file @
8a1ee557
...
...
@@ -40,6 +40,7 @@ class Review < ApplicationRecord
include
Complainable
after_save
:calculate_review_rate
after_destroy
:calculate_review_rate
belongs_to
:reviewable
,
polymorphic:
true
belongs_to
:user
...
...
@@ -88,7 +89,7 @@ class Review < ApplicationRecord
private
def
calculate_review_rate
ReviewAverageCalculatorWorker
.
perform_
async
(
reviewable
.
id
,
reviewable
.
class
.
name
)
ReviewAverageCalculatorWorker
.
perform_
in
(
1
.
minutes
,
reviewable
.
id
,
reviewable
.
class
.
name
)
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment