Skip to content

Commit

Permalink
style(rubocop): Style/For
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Feb 12, 2024
1 parent 6a58ecf commit 04a3483
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/helpers/application_helper.rb
Expand Up @@ -30,7 +30,7 @@ def domain_options_for_select(server, selected_domain = nil, options = {})
server_domains = server.domains.verified.order(:name)
unless server_domains.empty?
s << "<optgroup label='Server Domains'>"
for domain in server_domains
server_domains.each do |domain|
selected = domain == selected_domain ? "selected='selected'" : ""
s << "<option value='#{domain.id}' #{selected}>#{domain.name}</option>"
end
Expand All @@ -40,7 +40,7 @@ def domain_options_for_select(server, selected_domain = nil, options = {})
organization_domains = server.organization.domains.verified.order(:name)
unless organization_domains.empty?
s << "<optgroup label='Organization Domains'>"
for domain in organization_domains
organization_domains.each do |domain|
selected = domain == selected_domain ? "selected='selected'" : ""
s << "<option value='#{domain.id}' #{selected}>#{domain.name}</option>"
end
Expand All @@ -56,7 +56,7 @@ def endpoint_options_for_select(server, selected_value = nil, options = {})
http_endpoints = server.http_endpoints.order(:name).to_a
if http_endpoints.present?
s << "<optgroup label='HTTP Endpoints'>"
for endpoint in http_endpoints
http_endpoints.each do |endpoint|
value = "#{endpoint.class}##{endpoint.uuid}"
selected = value == selected_value ? "selected='selected'" : ""
s << "<option value='#{value}' #{selected}>#{endpoint.description}</option>"
Expand All @@ -67,7 +67,7 @@ def endpoint_options_for_select(server, selected_value = nil, options = {})
smtp_endpoints = server.smtp_endpoints.order(:name).to_a
if smtp_endpoints.present?
s << "<optgroup label='SMTP Endpoints'>"
for endpoint in smtp_endpoints
smtp_endpoints.each do |endpoint|
value = "#{endpoint.class}##{endpoint.uuid}"
selected = value == selected_value ? "selected='selected'" : ""
s << "<option value='#{value}' #{selected}>#{endpoint.description}</option>"
Expand All @@ -78,7 +78,7 @@ def endpoint_options_for_select(server, selected_value = nil, options = {})
address_endpoints = server.address_endpoints.order(:address).to_a
if address_endpoints.present?
s << "<optgroup label='Address Endpoints'>"
for endpoint in address_endpoints
address_endpoints.each do |endpoint|
value = "#{endpoint.class}##{endpoint.uuid}"
selected = value == selected_value ? "selected='selected'" : ""
s << "<option value='#{value}' #{selected}>#{endpoint.address}</option>"
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/unqueue_message_job.rb
Expand Up @@ -94,7 +94,7 @@ def perform
log "#{log_prefix} Message is a bounce"
original_messages = queued_message.message.original_messages
unless original_messages.empty?
for original_message in queued_message.message.original_messages
queued_message.message.original_messages.each do |original_message|
queued_message.message.update(bounce_for_id: original_message.id, domain_id: original_message.domain_id)
queued_message.message.create_delivery("Processed", details: "This has been detected as a bounce message for <msg:#{original_message.id}>.")
original_message.bounce!(queued_message.message)
Expand Down
2 changes: 1 addition & 1 deletion lib/postal/message_db/database.rb
Expand Up @@ -333,7 +333,7 @@ def query_on_connection(connection, query)
id = Nifty::Utils::RandomString.generate(length: 6).upcase
explain_result = ResultForExplainPrinter.new(connection.query("EXPLAIN #{query}"))
slow_query_logger.info "[#{id}] EXPLAIN #{query}"
for line in ActiveRecord::ConnectionAdapters::MySQL::ExplainPrettyPrinter.new.pp(explain_result, time).split("\n")
ActiveRecord::ConnectionAdapters::MySQL::ExplainPrettyPrinter.new.pp(explain_result, time).split("\n").each do |line|
slow_query_logger.info "[#{id}] " + line
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/postal/user_creator.rb
Expand Up @@ -23,7 +23,7 @@ def self.start(&block)
puts "User has been created with e-mail address \e[32m#{user.email_address}\e[0m"
else
puts "\e[31mFailed to create user\e[0m"
for error in user.errors.full_messages
user.errors.full_messages.each do |error|
puts " * #{error}"
end
end
Expand Down

0 comments on commit 04a3483

Please sign in to comment.