summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 09:56:46 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 09:56:46 +0000
commitf286a6044be49b88b067f89072618aecc7164caa (patch)
tree6359dfe601c787be72932e98a862f5b99e98d11f /app/models
parent65a91d13a0ef8a08f2cb118ea0bda716910db6a9 (diff)
downloadredmine-f286a6044be49b88b067f89072618aecc7164caa.tar.gz
redmine-f286a6044be49b88b067f89072618aecc7164caa.zip
Deprecate and rename rss_* methods to atom_* methods (#15118).
Patch by Mischa The Evil and Marius BÄ‚LTEANU git-svn-id: http://svn.redmine.org/redmine/trunk@21467 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/anonymous_user.rb2
-rw-r--r--app/models/user.rb26
2 files changed, 20 insertions, 8 deletions
diff --git a/app/models/anonymous_user.rb b/app/models/anonymous_user.rb
index eddcf814c..b4995d1d0 100644
--- a/app/models/anonymous_user.rb
+++ b/app/models/anonymous_user.rb
@@ -38,7 +38,7 @@ class AnonymousUser < User
def mail=(*args); nil end
def mail; nil end
def time_zone; nil end
- def rss_key; nil end
+ def atom_key; nil end
def pref
UserPreference.new(:user => self)
diff --git a/app/models/user.rb b/app/models/user.rb
index eac3d82ae..ffe147ba1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -87,7 +87,7 @@ class User < Principal
:after_remove => Proc.new {|user, group| group.user_removed(user)}
has_many :changesets, :dependent => :nullify
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
- has_one :rss_token, lambda {where "action='feeds'"}, :class_name => 'Token'
+ has_one :atom_token, lambda {where "action='feeds'"}, :class_name => 'Token'
has_one :api_token, lambda {where "action='api'"}, :class_name => 'Token'
has_one :email_address, lambda {where :is_default => true}, :autosave => true
has_many :email_addresses, :dependent => :delete_all
@@ -415,12 +415,18 @@ class User < Principal
self.pref[:comments_sorting] == 'desc'
end
- # Return user's RSS key (a 40 chars long string), used to access feeds
- def rss_key
- if rss_token.nil?
- create_rss_token(:action => 'feeds')
+ # Return user's ATOM key (a 40 chars long string), used to access feeds
+ def atom_key
+ if atom_token.nil?
+ create_atom_token(:action => 'feeds')
end
- rss_token.value
+ atom_token.value
+ end
+
+ # TODO: remove in Redmine 6.0
+ def rss_key
+ ActiveSupport::Deprecation.warn "User.rss_key is deprecated and will be removed in Redmine 6.0. Please use User.atom_key instead."
+ atom_key
end
# Return user's API key (a 40 chars long string), used to access the API
@@ -530,10 +536,16 @@ class User < Principal
end
end
- def self.find_by_rss_key(key)
+ def self.find_by_atom_key(key)
Token.find_active_user('feeds', key)
end
+ # TODO: remove in Redmine 6.0
+ def self.find_by_rss_key(key)
+ ActiveSupport::Deprecation.warn "User.find_by_rss_key is deprecated and will be removed in Redmine 6.0. Please use User.find_by_atom_key instead."
+ self.find_by_atom_key(key)
+ end
+
def self.find_by_api_key(key)
Token.find_active_user('api', key)
end