Skip to content

Commit

Permalink
Merge branch 'bugfix/star_cache' into 'master'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dzaporozhets committed Dec 3, 2015
2 parents 76f0054 + 82e916b commit 15ea128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/users_star_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15ea128

Please sign in to comment.