diff --git a/.rubocop.yml b/.rubocop.yml index 3b43b6fc2..d83db83e4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -59,11 +59,6 @@ Metrics/ModuleLength: Description: 'Avoid modules longer than 100 lines of code.' Enabled: false -Style/ClassVars: - Description: 'Avoid the use of class variables.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars' - Enabled: false - Style/CollectionMethods: Enabled: true PreferredMethods: @@ -108,11 +103,6 @@ Style/FrozenStringLiteralComment: to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: false -Style/FormatString: - Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf' - Enabled: false - Style/GlobalVars: Description: 'Do not introduce global variables.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars' @@ -128,11 +118,6 @@ Metrics/MethodLength: StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' Enabled: false -Style/MultilineBlockChain: - Description: 'Avoid multi-line chains of blocks.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' - Enabled: false - Style/Next: Description: 'Use `next` to skip iteration instead of a condition at the end.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' @@ -161,11 +146,6 @@ Style/SingleLineBlockParams: StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks' Enabled: false -Style/SignalException: - Description: 'Checks for proper usage of fail and raise.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' - Enabled: false - Style/StringLiterals: Description: 'Checks if uses of quotes match the configured preference.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals' @@ -184,40 +164,13 @@ Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: comma Enabled: true -Style/TrailingCommaInHashLiteral: - Description: 'Checks for trailing comma in hash literals.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' - EnforcedStyleForMultiline: no_comma - Enabled: true - -Style/TrivialAccessors: - Description: 'Prefer attr_* methods to trivial readers/writers.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family' - Enabled: false - # Layout -Layout/AlignParameters: - Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent' - Enabled: false - -Layout/ConditionPosition: - Description: >- - Checks for condition placed in a confusing position relative to - the keyword. - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition' - Enabled: false - Layout/DotPosition: Description: 'Checks the position of the dot in multi-line method calls.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains' EnforcedStyle: trailing -Layout/ExtraSpacing: - Description: 'Do not use unnecessary spacing.' - Enabled: true - Layout/MultilineOperationIndentation: Description: >- Checks indentation of binary operations that span more than @@ -232,11 +185,6 @@ Layout/MultilineMethodCallIndentation: Enabled: true EnforcedStyle: indented -Layout/InitialIndentation: - Description: >- - Checks the indentation of the first non-blank non-comment line in a file. - Enabled: false - # Rails Rails: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9e89df048..351868120 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -91,3 +91,30 @@ Rails/OutputSafety: Rails/SkipsModelValidations: Enabled: false + +Style/FormatString: + Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf' + Enabled: false + +Style/TrivialAccessors: + Description: 'Prefer attr_* methods to trivial readers/writers.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family' + Enabled: false + +Layout/AlignParameters: + Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent' + Enabled: false + +Layout/ConditionPosition: + Description: >- + Checks for condition placed in a confusing position relative to + the keyword. + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition' + Enabled: false + +Layout/InitialIndentation: + Description: >- + Checks the indentation of the first non-blank non-comment line in a file. + Enabled: false diff --git a/app/controllers/html_variants_controller.rb b/app/controllers/html_variants_controller.rb index 6fa383ac9..72b50219c 100644 --- a/app/controllers/html_variants_controller.rb +++ b/app/controllers/html_variants_controller.rb @@ -24,7 +24,7 @@ class HtmlVariantsController < ApplicationController def show @story_show = true - @@article_show = true + @article_show = true @html_variant = HtmlVariant.find(params[:id]) authorize @html_variant render layout: false diff --git a/app/models/chat_channel.rb b/app/models/chat_channel.rb index e6c6dfb41..6d93daf6f 100644 --- a/app/models/chat_channel.rb +++ b/app/models/chat_channel.rb @@ -71,7 +71,7 @@ class ChatChannel < ApplicationRecord slug = contrived_name.to_s.parameterize + "-" + rand(100_000).to_s(26) end - channel = ChatChannel.find_by_slug(slug) + channel = ChatChannel.find_by(slug: slug) if channel raise "Blocked channel" if channel.status == "blocked"