docbrown/app/controllers/admin
Jeremy Friesen 5534a8fa18
Addressing rubocop violations (#16156)
```shell
❯ bundle exec rubocop -A
Inspecting 1856 files

Offenses:

app/controllers/admin/settings/mandatory_settings_controller.rb:17:57: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
            settings_model.public_send("#{key}=", value.reject(&:blank?)) if value.present?
                                                        ^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:66:58: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      Honeycomb.add_field("error", @user.errors.messages.reject { |_, v| v.empty? })
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:280:58: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      Honeycomb.add_field("error", @user.errors.messages.reject { |_, v| v.empty? })
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/settings/base.rb:111:54: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
          value.split(separator || SEPARATOR_REGEXP).reject(&:empty?).map(&:strip)
                                                     ^^^^^^^^^^^^^^^^
app/services/articles/feeds/weighted_query_strategy.rb:269:121: C: Layout/LineLength: Line is too long. [126/120] (https://rubystyle.guide#max-line-length)
      def initialize(user: nil, number_of_articles: 50, page: 1, tag: nil, strategy: AbExperiment::ORIGINAL_VARIANT, **config)
                                                                                                                        ^^^^^^
app/services/images/optimizer.rb:27:50: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      options = DEFAULT_CL_OPTIONS.merge(kwargs).reject { |_, v| v.blank? }
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/images/optimizer.rb:46:68: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      options = DEFAULT_IMGPROXY_OPTIONS.merge(translated_options).reject { |_, v| v.blank? }
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/settings/upsert.rb:30:55: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
          settings_class.public_send("#{key}=", value.reject(&:blank?))
                                                      ^^^^^^^^^^^^^^^^

1856 files inspected, 8 offenses detected, 7 offenses corrected
```

After this commit:

```shell
❯ bundle exec rubocop
Inspecting 1856 files

1856 files inspected, no offenses detected
```

1856 files inspected, no offenses detected
2022-01-17 17:21:06 -05:00
..
settings Addressing rubocop violations (#16156) 2022-01-17 17:21:06 -05:00
tags Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
users Refactor Admin Member Detail view - Tools section (#14283) 2021-08-17 18:55:53 +02:00
application_controller.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
articles_controller.rb Extracting Article.featured scope (#15612) 2021-12-01 12:16:32 -05:00
badge_achievements_controller.rb Admin Save Confirmation - Removing Badge Achievements (#14684) 2021-09-15 21:25:01 -04:00
badges_controller.rb [15-min-fix] Remove badge slug field b/c auto-gen by title (#13649) 2021-05-05 13:49:43 -04:00
broadcasts_controller.rb Heavy Confirmation Flow for Broadcast-Destroy (#14819) 2021-09-29 07:43:00 -04:00
comments_controller.rb [deploy] Move /internal to `/admin (#9639) 2020-08-07 10:36:26 -04:00
consumer_apps_controller.rb Push Notification multi app support (#13304) 2021-04-21 17:13:01 -06:00
creator_settings_controller.rb Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
data_update_scripts_controller.rb Navigation Items and Role access for Data Update Scripts (#12292) 2021-02-09 17:41:14 +02:00
display_ads_controller.rb Upgrade Stimulus to 3.0 (#14869) 2021-10-05 20:00:37 +02:00
email_messages_controller.rb Remove resource_admin dashboards (Administrate) (#11792) 2020-12-08 12:38:13 -06:00
feedback_messages_controller.rb Ensure shown vomit reactions have reactable (#15153) 2021-10-21 11:34:06 -05:00
html_variants_controller.rb RFC#50-P5 Prepares the admin restructure to be tested (#13114) 2021-04-15 14:53:46 +02:00
invitations_controller.rb Change default value for saw_onboarding (#14105) 2021-06-30 14:03:42 -04:00
listing_categories_controller.rb RFC#50-P5 Prepares the admin restructure to be tested (#13114) 2021-04-15 14:53:46 +02:00
listings_controller.rb [15-min-fix] Add org id to admin listings form (#14162) 2021-07-08 09:23:10 -04:00
moderator_actions_controller.rb Favoring constant over magic string (#15852) 2021-12-27 11:31:29 -05:00
mods_controller.rb Move AssignTagModerator from labor to services (#11826) 2020-12-17 09:51:26 +07:00
navigation_links_controller.rb Static Sections for Site Navigation - Pt2 (#14292) 2021-07-23 17:53:55 -04:00
organization_memberships_controller.rb Refactor Admin Member Detail view - Tools section (#14283) 2021-08-17 18:55:53 +02:00
organizations_controller.rb Spelling fixes to live code (#15670) 2021-12-06 12:11:25 +02:00
overview_controller.rb Add open reports count to admin overview (#13346) 2021-04-12 12:03:11 -05:00
pages_controller.rb Use constants for controller allowed params (#14815) 2021-09-28 16:30:56 +02:00
permissions_controller.rb [deploy] Move /internal to `/admin (#9639) 2020-08-07 10:36:26 -04:00
podcasts_controller.rb Fix and clean up podcast pages (#15004) 2021-10-15 17:38:57 -04:00
privileged_reactions_controller.rb Caching sum privileged reaction scores (#15299) 2021-11-08 12:50:08 -05:00
profile_field_groups_controller.rb Profile Admin updates (#10133) 2020-09-02 12:32:25 +02:00
profile_fields_controller.rb [deploy] Add display_area & show_in_onboarding to the profile setup ui (#10158) 2020-09-02 16:30:33 -05:00
reactions_controller.rb [deploy] Move /internal to `/admin (#9639) 2020-08-07 10:36:26 -04:00
response_templates_controller.rb RFC#50-P5 Prepares the admin restructure to be tested (#13114) 2021-04-15 14:53:46 +02:00
secrets_controller.rb [deploy] Move /internal to `/admin (#9639) 2020-08-07 10:36:26 -04:00
settings_controller.rb Added the logo upload to the admin -> customization -> config -> images section. (#15729) 2021-12-15 14:10:27 -05:00
sponsorships_controller.rb RFC#50-P5 Prepares the admin restructure to be tested (#13114) 2021-04-15 14:53:46 +02:00
tags_controller.rb Remove name from allowed tag params in admin (#15382) 2021-11-15 14:58:24 -06:00
tools_controller.rb RFC#50-P5 Prepares the admin restructure to be tested (#13114) 2021-04-15 14:53:46 +02:00
users_controller.rb Show reactions to the user, rather than user created reactions to other users (#15243) 2021-11-01 12:55:39 -05:00
welcome_controller.rb Rename User.dev_account to User.staff_account (#14321) 2021-07-26 10:46:26 -04:00