Ir al contenido

Architecture contract (ARCH6204)

Esta página aún no está disponible en tu idioma.

Key ruby.architecture.contract · Severity error · Category architecture

Flags a constant reference against the layer direction, a vertical slice’s boundary or the project’s own architecture rules: code under packs/, components/, engines/, features/ or slices/ using another slice’s behaviour (a class with instance methods - its values, constants and structs are allowed); a service or model using a controller; a model using a service, repository or query object; or any dependency a rule in Project settings > Scanning forbids. Constants are resolved to files by the Rails (Zeitwerk) naming convention, the way Ruby looks them up; layers and slices are read from folders, not class names.

app/models/order.rb
class Order < ApplicationRecord
after_commit { OrderService::CreateOrderInSap.call(self) }
end
app/services/order_service/place_order.rb
class OrderService::PlaceOrder
def call(order)
order.save!
OrderService::CreateOrderInSap.call(order)
end
end