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
path: root/app
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-05-23 23:47:05 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-05-24 23:29:59 +0300
commit2f277d10ac574fbe6b19d22799bd32daf49de56b (patch)
tree7b2a2f645ec74850e1bd33ee8b97ee5bea7cc9ab /app
parentdfc2542f55953815f703d743635d6faf2523d1a1 (diff)
ensure rss token on read
we do this on attribute read since migrating all existing users is not a feasible solution.
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index a356419a796..cf3914568a6 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -153,7 +153,7 @@ class User < ActiveRecord::Base
before_validation :set_public_email, if: ->(user) { user.public_email_changed? }
after_update :update_emails_with_primary_email, if: ->(user) { user.email_changed? }
- before_save :ensure_authentication_token, :ensure_incoming_email_token, :ensure_rss_token
+ before_save :ensure_authentication_token, :ensure_incoming_email_token
before_save :ensure_external_user_rights
after_save :ensure_namespace_correct
after_initialize :set_projects_limit
@@ -1005,6 +1005,13 @@ class User < ActiveRecord::Base
save
end
+ # each existing user needs to have an `rss_token`.
+ # we do this on read since migrating all existing users is not a feasible
+ # solution.
+ def rss_token
+ ensure_rss_token!
+ end
+
protected
# override, from Devise::Validatable