diff --git a/app/models/domain.rb b/app/models/domain.rb index a248546..ae0b416 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -85,7 +85,7 @@ class Domain < ApplicationRecord def parent_domains parts = name.split(".") - parts[0, parts.size - 1].each_with_index.map do |p, i| + parts[0, parts.size - 1].each_with_index.map do |_, i| parts[i..-1].join(".") end end diff --git a/app/models/outgoing_message_prototype.rb b/app/models/outgoing_message_prototype.rb index a54a148..d1bff40 100644 --- a/app/models/outgoing_message_prototype.rb +++ b/app/models/outgoing_message_prototype.rb @@ -137,7 +137,7 @@ class OutgoingMessagePrototype end if attachments.present? - attachments.each_with_index do |attachment, index| + attachments.each do |attachment| if attachment[:name].blank? @errors << "AttachmentMissingName" unless @errors.include?("AttachmentMissingName") elsif attachment[:data].blank? diff --git a/app/models/route.rb b/app/models/route.rb index dbc653b..0561551 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -117,7 +117,7 @@ class Route < ApplicationRecord if route.save seen << route.id else - route.errors.each do |field, message| + route.errors.each do |_, message| errors.add :base, message end raise ActiveRecord::RecordInvalid diff --git a/app/models/server.rb b/app/models/server.rb index 63439b6..33a72ca 100644 --- a/app/models/server.rb +++ b/app/models/server.rb @@ -157,7 +157,7 @@ class Server < ApplicationRecord time = Time.now.utc total_outgoing = 0.0 total_bounces = 0.0 - message_db.statistics.get(:daily, [:outgoing, :bounces], time, 30).each do |date, stat| + message_db.statistics.get(:daily, [:outgoing, :bounces], time, 30).each do |_, stat| total_outgoing += stat[:outgoing] total_bounces += stat[:bounces] end diff --git a/config/application.rb b/config/application.rb index a7879aa..d0fb313 100644 --- a/config/application.rb +++ b/config/application.rb @@ -32,7 +32,7 @@ module Postal config.eager_load_paths << Rails.root.join("lib") # Disable field_with_errors - config.action_view.field_error_proc = proc { |t, i| t } + config.action_view.field_error_proc = proc { |t, _| t } # Load the tracking server middleware require "postal/tracking_middleware" diff --git a/lib/postal/message_db/message.rb b/lib/postal/message_db/message.rb index ce7a72a..df778d0 100644 --- a/lib/postal/message_db/message.rb +++ b/lib/postal/message_db/message.rb @@ -553,14 +553,14 @@ module Postal private def _update - @database.update("messages", @attributes.reject { |k, v| k == :id }, where: { id: @attributes["id"] }) + @database.update("messages", @attributes.reject { |k, _| k == :id }, where: { id: @attributes["id"] }) end def _create self.timestamp = Time.now.to_f if timestamp.blank? self.status = "Pending" if status.blank? self.token = Nifty::Utils::RandomString.generate(length: 12) if token.blank? - last_id = @database.insert("messages", @attributes.reject { |k, v| k == :id }) + last_id = @database.insert("messages", @attributes.reject { |k, _| k == :id }) @attributes["id"] = last_id @database.statistics.increment_all(timestamp, scope) Statistic.global.increment!(:total_messages) diff --git a/lib/postal/smtp_server/client.rb b/lib/postal/smtp_server/client.rb index 6e8514d..78e9651 100644 --- a/lib/postal/smtp_server/client.rb +++ b/lib/postal/smtp_server/client.rb @@ -188,7 +188,7 @@ module Postal authenticate(password) end - username_handler = proc do |data| + username_handler = proc do @proc = password_handler @password_expected_next = true "334 UGFzc3dvcmQ6" # "Password:" diff --git a/spec/lib/postal/message_db/connection_pool_spec.rb b/spec/lib/postal/message_db/connection_pool_spec.rb index 506359a..cbc730b 100644 --- a/spec/lib/postal/message_db/connection_pool_spec.rb +++ b/spec/lib/postal/message_db/connection_pool_spec.rb @@ -26,7 +26,7 @@ describe Postal::MessageDB::ConnectionPool do it "checks in a connection if theres an error in the block" do expect do - pool.use do |c| + pool.use do raise StandardError end end.to raise_error StandardError