-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
No superclass, on_breach is called:
module Api
module V2
class FetchThreedsParams
include Interactor
include Interactor::Contracts
expects do
required(:user).filled
end
on_breach do |breaches|
puts '1'*30
end
before do
end
def call
end
end
end
end
# rails c
# Running via Spring preloader in process 70120
# Loading development environment (Rails 5.2.4.4)
# 2.5.1 :001 > Api::V2::FetchThreedsParams.call
# 111111111111111111111111111
# => #<Interactor::Context>With superclass, on_breach is not called:
class BaseInteractor
include Interactor
include Interactor::Contracts
end
module Api
class FetchThreedsParams < ::BaseInteractor
expects do
required(:user).filled
end
on_breach do |breaches|
puts '1'*30
end
before do
end
def call
end
end
end
# rails c
# Running via Spring preloader in process 70120
# Loading development environment (Rails 5.2.4.4)
# 2.5.1 :001 > Api::FetchThreedsParams.call
# => #<Interactor::Context user=["user is missing"]>What i am doing wrong?
https://github.com/c080609a/schema_test - example project (Rails 5.2.4.4, ruby-2.5.1, 3 classes, no database).
Metadata
Metadata
Assignees
Labels
No labels