Skip to content

Commit 1f17f0d

Browse files
committed
fixing rubocop
1 parent 95cd5bb commit 1f17f0d

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

app/controllers/admin/mailing_lists_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class Admin::MailingListsController < Admin::BaseController
4-
before_action :set_mailing_list, only: [:edit, :update]
4+
before_action :set_mailing_list, only: [ :edit, :update ]
55

66
def active_admin_section
77
:mailing_lists
@@ -16,7 +16,7 @@ def index
1616
)
1717
.order(:display_name)
1818

19-
@topic_list_distribution = TopicMailingList.connection.select_rows(<<~SQL).to_h { |c, t| [c.to_i, t.to_i] }
19+
@topic_list_distribution = TopicMailingList.connection.select_rows(<<~SQL).to_h { |c, t| [ c.to_i, t.to_i ] }
2020
SELECT lists_count, COUNT(*) AS topic_count
2121
FROM (SELECT COUNT(*) AS lists_count FROM topic_mailing_lists GROUP BY topic_id) counts
2222
GROUP BY lists_count ORDER BY lists_count

app/models/mailing_list.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class MailingList < ApplicationRecord
88
validates :display_name, presence: true
99

1010
def all_emails
11-
[email, *alternate_emails].compact.reject(&:blank?).map(&:downcase)
11+
[ email, *alternate_emails ].compact.reject(&:blank?).map(&:downcase)
1212
end
1313

1414
def self.email_lookup_index

db/migrate/20260324054041_create_mailing_list_tables.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ def up
1515
t.references :mailing_list, null: false, foreign_key: true
1616
t.timestamps
1717
end
18-
add_index :message_mailing_lists, [:message_id, :mailing_list_id], unique: true, name: "idx_message_mailing_lists_unique"
18+
add_index :message_mailing_lists, [ :message_id, :mailing_list_id ], unique: true, name: "idx_message_mailing_lists_unique"
1919

2020
create_table :topic_mailing_lists do |t|
2121
t.references :topic, null: false, foreign_key: true
2222
t.references :mailing_list, null: false, foreign_key: true
2323
t.timestamps
2424
end
25-
add_index :topic_mailing_lists, [:topic_id, :mailing_list_id], unique: true, name: "idx_topic_mailing_lists_unique"
25+
add_index :topic_mailing_lists, [ :topic_id, :mailing_list_id ], unique: true, name: "idx_topic_mailing_lists_unique"
2626

2727
hackers = execute <<~SQL
2828
INSERT INTO mailing_lists (identifier, display_name, email, created_at, updated_at)

script/imap_idle.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
Signal.trap('INT') { stop_w.write_nonblock("\0") rescue nil }
4949

5050
Thread.new do
51-
IO.select([stop_r])
51+
IO.select([ stop_r ])
5252
stop_r.close
5353
logger.info('[imap_idle] Signal received, stopping...') if logger
5454
runner.stop!

spec/models/mailing_list_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
describe ".email_lookup_index" do
1313
it "indexes by primary and alternate emails" do
1414
ml = create(:mailing_list, email: "pgsql-hackers@lists.postgresql.org",
15-
alternate_emails: ["pgsql-hackers@postgresql.org"])
15+
alternate_emails: [ "pgsql-hackers@postgresql.org" ])
1616
index = described_class.email_lookup_index
1717
expect(index["pgsql-hackers@lists.postgresql.org"]).to eq(ml)
1818
expect(index["pgsql-hackers@postgresql.org"]).to eq(ml)

spec/services/imap_idle_runner_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
state = ImapSyncState.for_label("INBOX")
5858
allow(imap_client).to receive(:connect!).and_return(true)
5959
allow(imap_client).to receive(:disconnect!).and_return(true)
60-
expect(imap_client).to receive(:uids_after).with(0).and_return([201])
60+
expect(imap_client).to receive(:uids_after).with(0).and_return([ 201 ])
6161
raw = <<~MAIL
6262
From: Test <test@example.com>
6363
To: pgsql-hackers@lists.postgresql.org
@@ -83,11 +83,11 @@
8383
end
8484

8585
it "resolves list from alternate email in CC" do
86-
hackers_list.update!(alternate_emails: ["pgsql-hackers@postgresql.org"])
86+
hackers_list.update!(alternate_emails: [ "pgsql-hackers@postgresql.org" ])
8787
state = ImapSyncState.for_label("INBOX")
8888
allow(imap_client).to receive(:connect!).and_return(true)
8989
allow(imap_client).to receive(:disconnect!).and_return(true)
90-
expect(imap_client).to receive(:uids_after).with(0).and_return([203])
90+
expect(imap_client).to receive(:uids_after).with(0).and_return([ 203 ])
9191
raw = <<~MAIL
9292
From: Test <test@example.com>
9393
To: peter@eisentraut.org
@@ -117,7 +117,7 @@
117117
state = ImapSyncState.for_label("INBOX")
118118
allow(imap_client).to receive(:connect!).and_return(true)
119119
allow(imap_client).to receive(:disconnect!).and_return(true)
120-
expect(imap_client).to receive(:uids_after).with(0).and_return([202])
120+
expect(imap_client).to receive(:uids_after).with(0).and_return([ 202 ])
121121
raw = <<~MAIL
122122
From: Test <test@example.com>
123123
To: someone@example.com

0 commit comments

Comments
 (0)