diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-03 19:23:45 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-03 19:23:45 +0000 |
commit | 15ea12859c8e700f47cdba6134411b8580e9d0cf (patch) | |
tree | 8025aea79e24b7dfc4468011ae0fc4b5676f3ad5 | |
parent | 76f0054220e0ff6c37f69702e1fa5005ded1f402 (diff) | |
parent | 82e916b0f2cbd500d14f545095ac82464c0a3889 (diff) | |
download | gitlab-ce-15ea12859c8e700f47cdba6134411b8580e9d0cf.tar.gz |
Merge branch 'bugfix/star_cache' into 'master'
Touch project when toggling stars to update cache
This is a fix for gitlab-org/gitlab-ce#3513.
When a star toggle event happens, we touch project to clear cache key.
This will trigger a new "updated_at" at the project model. If it's undesirable, please let me know and I will try to solve it in a different way.
See merge request !1970
-rw-r--r-- | app/models/users_star_project.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/users_star_project.rb b/app/models/users_star_project.rb index 3d49cb05949..413f3f485a8 100644 --- a/app/models/users_star_project.rb +++ b/app/models/users_star_project.rb @@ -10,7 +10,7 @@ # class UsersStarProject < ActiveRecord::Base - belongs_to :project, counter_cache: :star_count + belongs_to :project, counter_cache: :star_count, touch: true belongs_to :user validates :user, presence: true |