mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Prefer public_send
over send
.
This commit is contained in:
@ -117,20 +117,20 @@ class ListController < ApplicationController
|
||||
|
||||
define_method("category_#{filter}") do
|
||||
canonical_url "#{Discourse.base_url_no_prefix}#{@category.url}"
|
||||
self.send(filter, category: @category.id)
|
||||
self.public_send(filter, category: @category.id)
|
||||
end
|
||||
|
||||
define_method("category_none_#{filter}") do
|
||||
self.send(filter, category: @category.id, no_subcategories: true)
|
||||
self.public_send(filter, category: @category.id, no_subcategories: true)
|
||||
end
|
||||
|
||||
define_method("parent_category_category_#{filter}") do
|
||||
canonical_url "#{Discourse.base_url_no_prefix}#{@category.url}"
|
||||
self.send(filter, category: @category.id)
|
||||
self.public_send(filter, category: @category.id)
|
||||
end
|
||||
|
||||
define_method("parent_category_category_none_#{filter}") do
|
||||
self.send(filter, category: @category.id)
|
||||
self.public_send(filter, category: @category.id)
|
||||
end
|
||||
end
|
||||
|
||||
@ -142,7 +142,7 @@ class ListController < ApplicationController
|
||||
if view_method == 'top'
|
||||
top(category: @category.id)
|
||||
else
|
||||
self.send(view_method)
|
||||
self.public_send(view_method)
|
||||
end
|
||||
end
|
||||
|
||||
@ -237,7 +237,10 @@ class ListController < ApplicationController
|
||||
@link = "#{Discourse.base_url}/u/#{target_user.username}/activity/topics"
|
||||
@atom_link = "#{Discourse.base_url}/u/#{target_user.username}/activity/topics.rss"
|
||||
@description = I18n.t("rss_description.user_topics", username: target_user.username)
|
||||
@topic_list = TopicQuery.new(nil, order: 'created').send("list_topics_by", target_user)
|
||||
|
||||
@topic_list = TopicQuery
|
||||
.new(nil, order: 'created')
|
||||
.public_send("list_topics_by", target_user)
|
||||
|
||||
render 'list', formats: [:rss]
|
||||
end
|
||||
@ -285,15 +288,18 @@ class ListController < ApplicationController
|
||||
end
|
||||
|
||||
define_method("category_top_#{period}") do
|
||||
self.send("top_#{period}", category: @category.id)
|
||||
self.public_send("top_#{period}", category: @category.id)
|
||||
end
|
||||
|
||||
define_method("category_none_top_#{period}") do
|
||||
self.send("top_#{period}", category: @category.id, no_subcategories: true)
|
||||
self.public_send("top_#{period}",
|
||||
category: @category.id,
|
||||
no_subcategories: true
|
||||
)
|
||||
end
|
||||
|
||||
define_method("parent_category_category_top_#{period}") do
|
||||
self.send("top_#{period}", category: @category.id)
|
||||
self.public_send("top_#{period}", category: @category.id)
|
||||
end
|
||||
|
||||
# rss feed
|
||||
@ -398,7 +404,7 @@ class ListController < ApplicationController
|
||||
end
|
||||
|
||||
def generate_list_for(action, target_user, opts)
|
||||
TopicQuery.new(current_user, opts).send("list_#{action}", target_user)
|
||||
TopicQuery.new(current_user, opts).public_send("list_#{action}", target_user)
|
||||
end
|
||||
|
||||
def construct_url_with(action, opts, url_prefix = nil)
|
||||
|
Reference in New Issue
Block a user