1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

style(rubocop): Lint/IneffectiveAccessModifier

هذا الالتزام موجود في:
Adam Cooke
2024-02-10 23:03:28 +00:00
الأصل c558f1c69c
التزام 6ad56ee9c9
4 ملفات معدلة مع 71 إضافات و55 حذوفات

عرض الملف

@@ -68,18 +68,22 @@ class IPPoolRule < ApplicationRecord
errors.add :ip_pool_id, "must belong to the organization"
end
def self.address_matches?(condition, address)
address = Postal::Helpers.strip_name_from_address(address)
if condition =~ /@/
parts = address.split("@")
domain = parts.pop
uname = parts.join("@")
uname, = uname.split("+", 2)
condition == "#{uname}@#{domain}"
else
# Match as a domain
condition == address.split("@").last
class << self
def address_matches?(condition, address)
address = Postal::Helpers.strip_name_from_address(address)
if condition =~ /@/
parts = address.split("@")
domain = parts.pop
uname = parts.join("@")
uname, = uname.split("+", 2)
condition == "#{uname}@#{domain}"
else
# Match as a domain
condition == address.split("@").last
end
end
end
end

عرض الملف

@@ -219,12 +219,16 @@ class Route < ApplicationRecord
errors.add :base, "Additional routes are not permitted unless the primary route is an actual endpoint"
end
def self.find_by_name_and_domain(name, domain)
route = Route.includes(:domain).where(name: name, domains: { name: domain }).first
if route.nil?
route = Route.includes(:domain).where(name: "*", domains: { name: domain }).first
class << self
def find_by_name_and_domain(name, domain)
route = Route.includes(:domain).where(name: name, domains: { name: domain }).first
if route.nil?
route = Route.includes(:domain).where(name: "*", domains: { name: domain }).first
end
route
end
route
end
end