1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-01-21 07:09:48 +00:00

style(rubocop): fix all safe auto correctable offenses

هذا الالتزام موجود في:
Charlie Smurthwaite
2023-03-16 15:50:53 +00:00
الأصل 02c93a4850
التزام fd289c46fd
204 ملفات معدلة مع 2611 إضافات و2486 حذوفات

عرض الملف

@@ -16,10 +16,10 @@ class AddressEndpoint < ApplicationRecord
include HasUUID
belongs_to :server
has_many :routes, :as => :endpoint
has_many :additional_route_endpoints, :dependent => :destroy, :as => :endpoint
has_many :routes, as: :endpoint
has_many :additional_route_endpoints, dependent: :destroy, as: :endpoint
validates :address, :presence => true, :format => {:with => /@/}, :uniqueness => {:scope => [:server_id], :message => "has already been added"}
validates :address, presence: true, format: { with: /@/ }, uniqueness: { scope: [:server_id], message: "has already been added" }
before_destroy :update_routes
@@ -28,15 +28,15 @@ class AddressEndpoint < ApplicationRecord
end
def update_routes
self.routes.each { |r| r.update(:endpoint => nil, :mode => 'Reject') }
routes.each { |r| r.update(endpoint: nil, mode: "Reject") }
end
def description
self.address
address
end
def domain
address.split('@', 2).last
address.split("@", 2).last
end
end