style(rubocop): Style/MutableConstant

This commit is contained in:
Adam Cooke
2024-02-10 17:34:29 +00:00
parent d508772a40
commit 129dffab9e
14 changed files with 21 additions and 24 deletions
+3 -4
View File
@@ -24,7 +24,9 @@
class Route < ApplicationRecord
MODES = ["Endpoint", "Accept", "Hold", "Bounce", "Reject"]
MODES = ["Endpoint", "Accept", "Hold", "Bounce", "Reject"].freeze
SPAM_MODES = ["Mark", "Quarantine", "Fail"].freeze
ENDPOINT_TYPES = ["SMTPEndpoint", "HTTPEndpoint", "AddressEndpoint"].freeze
include HasUUID
@@ -33,9 +35,6 @@ class Route < ApplicationRecord
belongs_to :endpoint, polymorphic: true, optional: true
has_many :additional_route_endpoints, dependent: :destroy
SPAM_MODES = ["Mark", "Quarantine", "Fail"]
ENDPOINT_TYPES = ["SMTPEndpoint", "HTTPEndpoint", "AddressEndpoint"]
validates :name, presence: true, format: /\A(([a-z0-9\-.]*)|(\*)|(__returnpath__))\z/
validates :spam_mode, inclusion: { in: SPAM_MODES }
validates :endpoint, presence: { if: proc { mode == "Endpoint" } }