DEV: Prefer `public_send` over `send`.

DEV: Prefer public_send over send.

diff --git a/app/controllers/admin/badges_controller.rb b/app/controllers/admin/badges_controller.rb
index 90da2ff..0a1b741 100644
--- a/app/controllers/admin/badges_controller.rb
+++ b/app/controllers/admin/badges_controller.rb
@@ -108,7 +108,7 @@ class Admin::BadgesController < Admin::AdminController
       params.permit(*allowed)
 
       allowed.each do |key|
-        badge.send("#{key}=" , params[key]) if params[key]
+        badge.public_send("#{key}=" , params[key]) if params[key]
       end
 
       # Badge query contract checks
diff --git a/app/controllers/admin/email_controller.rb b/app/controllers/admin/email_controller.rb
index a668f71..e8c8111 100644
--- a/app/controllers/admin/email_controller.rb
+++ b/app/controllers/admin/email_controller.rb
@@ -113,7 +113,11 @@ class Admin::EmailController < Admin::AdminController
     params.require(:username)
     params.require(:email)
     user = User.find_by_username(params[:username])
-    message, skip_reason = UserNotifications.send(:digest, user, since: params[:last_seen_at])
+
+    message, skip_reason = UserNotifications.public_send(:digest, user,
+      since: params[:last_seen_at]
+    )
+
     if message
       message.to = params[:email]
       begin
diff --git a/app/controllers/admin/embedding_controller.rb b/app/controllers/admin/embedding_controller.rb
index d1b645e..e2559fb 100644
--- a/app/controllers/admin/embedding_controller.rb
+++ b/app/controllers/admin/embedding_controller.rb
@@ -16,7 +16,7 @@ class Admin::EmbeddingController < Admin::AdminController
     end
 
     Embedding.settings.each do |s|
-      @embedding.send("#{s}=", params[:embedding][s])
+      @embedding.public_send("#{s}=", params[:embedding][s])
     end
 
     if @embedding.save
diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rb
index 9e4d78d..042f5bc 100644
--- a/app/controllers/admin/themes_controller.rb
+++ b/app/controllers/admin/themes_controller.rb
@@ -157,7 +157,7 @@ class Admin::ThemesController < Admin::AdminController
 
     [:name, :color_scheme_id, :user_selectable].each do |field|
       if theme_params.key?(field)
-        @theme.send("#{field}=", theme_params[field])
+        @theme.public_send("#{field}=", theme_params[field])
       end
     end
 
diff --git a/app/controllers/admin/user_fields_controller.rb b/app/controllers/admin/user_fields_controller.rb
index 4ac32bb..1139560 100644
--- a/app/controllers/admin/user_fields_controller.rb
+++ b/app/controllers/admin/user_fields_controller.rb
@@ -27,7 +27,7 @@ class Admin::UserFieldsController < Admin::AdminController
 
     Admin::UserFieldsController.columns.each do |col|
       unless field_params[col].nil?
-        field.send("#{col}=", field_params[col])
+        field.public_send("#{col}=", field_params[col])
       end
     end
     update_options(field)
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 0bdc7bb..4b77c5d 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -254,7 +254,7 @@ class Admin::UsersController < Admin::AdminController
     level = params[:level].to_i
 
     if @user.manual_locked_trust_level.nil?
-      if [0, 1, 2].include?(level) && Promotion.send("tl#{level + 1}_met?", @user)
+      if [0, 1, 2].include?(level) && Promotion.public_send("tl#{level + 1}_met?", @user)
         @user.manual_locked_trust_level = level
         @user.save
       elsif level == 3 && Promotion.tl3_lost?(@user)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ddce493..152beba 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -628,10 +628,10 @@ class ApplicationController < ActionController::Base
       error_obj = nil
       if opts[:additional_errors]
         error_target = opts[:additional_errors].find do |o|
-          target = obj.send(o)
+          target = obj.public_send(o)
           target && target.errors.present?
         end
-        error_obj = obj.send(error_target) if error_target
+        error_obj = obj.public_send(error_target) if error_target
       end
       render_json_error(error_obj || obj)
     end
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index 7723b7f..b4f8036 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -240,9 +240,9 @@ class CategoriesController < ApplicationController
     draft = Draft.get(current_user, draft_key, draft_sequence) if current_user
 
     %w{category topic}.each do |type|
-      result.send(:"#{type}_list").draft = draft
-      result.send(:"#{type}_list").draft_key = draft_key
-      result.send(:"#{type}_list").draft_sequence = draft_sequence
+      result.public_send(:"#{type}_list").draft = draft
+      result.public_send(:"#{type}_list").draft_key = draft_key
+      result.public_send(:"#{type}_list").draft_sequence = draft_sequence
     end
 
     render_serialized(result, CategoryAndTopicListsSerializer, root: false)
diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb
index fa2c4a0..f7bed67 100644
--- a/app/controllers/list_controller.rb
+++ b/app/controllers/list_controller.rb
@@ -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)

[... diff too long, it was truncated ...]

GitHub sha: 152238b4

Fix rebase fail in 152238b4cff7ab4c4ce63ba26abd23b0abf05129.

Follow up to 152238b4cff7ab4c4ce63ba26abd23b0abf05129.