A platform for community discussion. Free, open, simple.
DEV: Fix Lint/DuplicateMethods (#24746)
Jarek Radosz138bf486d344
diff --git a/app/models/about.rb b/app/models/about.rbindex 6deb4ff4f4f..4a1821d1c0a 100644--- a/app/models/about.rb+++ b/app/models/about.rb@@ -18,8 +18,6 @@ class Aboutinclude ActiveModel::Serializationinclude StatsCacheable- attr_accessor :moderators, :admins-def self.stats_cache_key"about-stats"enddiff --git a/app/models/email_style.rb b/app/models/email_style.rbindex 88b4b7692ad..4035584ae2d 100644--- a/app/models/email_style.rb+++ b/app/models/email_style.rb@@ -3,8 +3,6 @@class EmailStyleinclude ActiveModel::Serialization- attr_accessor :html, :css, :default_html, :default_css-def id"email-style"enddiff --git a/app/models/report.rb b/app/models/report.rbindex 1a29f284fab..e53f0cfedae 100644--- a/app/models/report.rb+++ b/app/models/report.rb@@ -76,8 +76,6 @@ class Report:icon,:modes,:prev_data,- :prev_start_date,- :prev_end_date,:dates_filtering,:error,:primary_color,diff --git a/app/models/search_log.rb b/app/models/search_log.rbindex 8d4e1d7e7e6..b87231d63fa 100644--- a/app/models/search_log.rb+++ b/app/models/search_log.rb@@ -5,8 +5,6 @@ class SearchLog < ActiveRecord::Basebelongs_to :user- attr_reader :ctr-def ctrreturn 0 if click_through == 0 || searches == 0diff --git a/app/models/tag_group.rb b/app/models/tag_group.rbindex 802ab651ac2..d00fb9eb055 100644--- a/app/models/tag_group.rb+++ b/app/models/tag_group.rb@@ -22,7 +22,7 @@ class TagGroup < ActiveRecord::Baseafter_commit { DiscourseTagging.clear_cache! }- attr_accessor :permissions+ attr_reader :permissionsdef tag_names=(tag_names_arg)DiscourseTagging.add_or_create_tags_by_name(self, tag_names_arg, unlimited: true)diff --git a/app/models/topic_list.rb b/app/models/topic_list.rbindex 6061747eee5..a9771d1181d 100644--- a/app/models/topic_list.rb+++ b/app/models/topic_list.rb@@ -40,7 +40,6 @@ class TopicList:filter,:for_period,:per_page,- :top_tags,:current_user,:tags,:shared_drafts,diff --git a/app/models/trust_level3_requirements.rb b/app/models/trust_level3_requirements.rbindex 8c2889d6fa7..02960f833d8 100644--- a/app/models/trust_level3_requirements.rb+++ b/app/models/trust_level3_requirements.rb@@ -26,33 +26,6 @@ class TrustLevel3RequirementsLOW_WATER_MARK = 0.9FORGIVENESS_PERIOD = 6.months- attr_accessor :days_visited,- :min_days_visited,- :num_topics_replied_to,- :min_topics_replied_to,- :topics_viewed,- :min_topics_viewed,- :posts_read,- :min_posts_read,- :topics_viewed_all_time,- :min_topics_viewed_all_time,- :posts_read_all_time,- :min_posts_read_all_time,- :num_flagged_posts,- :max_flagged_posts,- :num_likes_given,- :min_likes_given,- :num_likes_received,- :min_likes_received,- :num_likes_received,- :min_likes_received,- :num_likes_received_days,- :min_likes_received_days,- :num_likes_received_users,- :min_likes_received_users,- :trust_level_locked,- :on_grace_period-def initialize(user)@user = userenddiff --git a/app/serializers/user_post_bookmark_serializer.rb b/app/serializers/user_post_bookmark_serializer.rbindex a9b32aad7e4..94a775a6988 100644--- a/app/serializers/user_post_bookmark_serializer.rb+++ b/app/serializers/user_post_bookmark_serializer.rb@@ -1,8 +1,6 @@# frozen_string_literal: trueclass UserPostBookmarkSerializer < UserPostTopicBookmarkBaseSerializer- attr_reader :post_id-def post_idpost.idenddiff --git a/lib/has_errors.rb b/lib/has_errors.rbindex daa8bb8e8d3..bd50e403f45 100644--- a/lib/has_errors.rb+++ b/lib/has_errors.rb@@ -3,7 +3,6 @@# Helper functions for dealing with errors and objects that have# child objects with errorsmodule HasErrors- attr_reader :errorsattr_accessor :forbidden, :not_found, :conflictdef errorsdiff --git a/lib/import_export/base_exporter.rb b/lib/import_export/base_exporter.rbindex 2effbd2d9fe..640278ceacd 100644--- a/lib/import_export/base_exporter.rb+++ b/lib/import_export/base_exporter.rb@@ -2,7 +2,7 @@module ImportExportclass BaseExporter- attr_reader :export_data, :categories+ attr_reader :export_dataCATEGORY_ATTRS = %i[iddiff --git a/plugins/chat/app/serializers/chat/user_message_bookmark_serializer.rb b/plugins/chat/app/serializers/chat/user_message_bookmark_serializer.rbindex f1ba24bdc16..716dfd67be3 100644--- a/plugins/chat/app/serializers/chat/user_message_bookmark_serializer.rb+++ b/plugins/chat/app/serializers/chat/user_message_bookmark_serializer.rb@@ -2,8 +2,6 @@module Chatclass UserMessageBookmarkSerializer < UserBookmarkBaseSerializer- attr_reader :chat_message-def titlefancy_titleenddiff --git a/plugins/chat/spec/system/page_objects/chat/components/messages.rb b/plugins/chat/spec/system/page_objects/chat/components/messages.rbindex a72fe146711..24f6472d73b 100644--- a/plugins/chat/spec/system/page_objects/chat/components/messages.rb+++ b/plugins/chat/spec/system/page_objects/chat/components/messages.rb@@ -16,10 +16,6 @@ module PageObjectspage.find(context)end- def flag(message)- find(message).secondary_action("flag")- end-def copy_link(message)find(message).secondary_action("copyLink")enddiff --git a/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb b/plugins/chat/spec/system/page_objects/chat/components/thread_list.rbindex 7811a68d49a..47f37c810fe 100644--- a/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb+++ b/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb@@ -43,10 +43,6 @@ module PageObjects".chat-thread-list-item__last-reply-timestamp .relative-date[data-time='#{(last_reply.created_at.iso8601.to_time.to_f * 1000).to_i}']"end- def has_no_unread_item?(id)- component.has_no_css?(item_by_id_selector(id) + ".-is-unread")- end-def has_unread_item?(id, count: nil)if count.nil?component.has_css?(item_by_id_selector(id) + ".-is-unread")diff --git a/plugins/chat/spec/system/page_objects/sidebar/sidebar.rb b/plugins/chat/spec/system/page_objects/sidebar/sidebar.rbindex 448c9e5b0b1..3d4bc229250 100644--- a/plugins/chat/spec/system/page_objects/sidebar/sidebar.rb+++ b/plugins/chat/spec/system/page_objects/sidebar/sidebar.rb@@ -14,10 +14,6 @@ module PageObjectsfind(PUBLIC_CHANNELS_SECTION_SELECTOR)end- def channels_section- find(PUBLIC_CHANNELS_SECTION_SELECTOR)- end-def dms_sectionfind(DM_CHANNELS_SECTION_SELECTOR)enddiff --git a/spec/support/fake_logger.rb b/spec/support/fake_logger.rbindex 376aab4c8c8..15c1a9e5f32 100644--- a/spec/support/fake_logger.rb+++ b/spec/support/fake_logger.rb@@ -1,11 +1,11 @@# frozen_string_literal: trueclass FakeLogger- attr_reader :debug, :infos, :warnings, :errors, :fatals+ attr_reader :debugs, :infos, :warnings, :errors, :fatalsattr_accessor :leveldef initialize- @debug = []+ @debugs = []@infos = []@warnings = []@errors = []@@ -14,7 +14,7 @@ class FakeLoggerenddef debug(message)- @debug << message+ @debugs << messageenddef debug?diff --git a/spec/system/page_objects/modals/sidebar_edit_categories.rb b/spec/system/page_objects/modals/sidebar_edit_categories.rbindex 56d96472175..2b132eca2bb 100644--- a/spec/system/page_objects/modals/sidebar_edit_categories.rb+++ b/spec/system/page_objects/modals/sidebar_edit_categories.rb@@ -39,12 +39,6 @@ module PageObjectsexpect(categories.map(&:text)).to eq(category_names)end- def has_checkbox?(category, disabled: false)- has_selector?(- ".sidebar-categories-form .sidebar-categories-form__category-row[data-category-id='#{category.id}'] .sidebar-categories-form__input#{disabled ? "[disabled]" : ""}",- )- end-def toggle_category_checkbox(category)find(".sidebar-categories-form .sidebar-categories-form__category-row[data-category-id='#{category.id}'] .sidebar-categories-form__input",