diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-05-23 22:47:05 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-05-24 22:29:59 +0200 |
commit | 2f277d10ac574fbe6b19d22799bd32daf49de56b (patch) | |
tree | 7b2a2f645ec74850e1bd33ee8b97ee5bea7cc9ab /app | |
parent | dfc2542f55953815f703d743635d6faf2523d1a1 (diff) | |
download | gitlab-ce-2f277d10ac574fbe6b19d22799bd32daf49de56b.tar.gz |
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.rb | 9 |
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 |