1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

style(rubocop): Style/MutableConstant

هذا الالتزام موجود في:
Adam Cooke
2024-02-10 17:34:29 +00:00
الأصل d508772a40
التزام 129dffab9e
14 ملفات معدلة مع 21 إضافات و24 حذوفات

عرض الملف

@@ -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" } }