Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #377 from dark-panda/rails-8
Browse files Browse the repository at this point in the history
Add support for Rails 8
  • Loading branch information
aaronmallen authored Nov 20, 2024
2 parents 9460cfa + 701c6a6 commit bd014d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions activeinteractor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
'wiki_uri' => 'https://github.com/aaronmallen/activeinteractor/wiki'
}

spec.add_dependency 'activemodel', '>= 4.2', '< 8'
spec.add_dependency 'activesupport', '>= 4.2', '< 8'
spec.add_dependency 'activemodel', '>= 4.2', '< 9'
spec.add_dependency 'activesupport', '>= 4.2', '< 9'

spec.add_development_dependency 'bundler', '~> 2.3'
end
12 changes: 11 additions & 1 deletion lib/active_interactor/organizer/interactor_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,22 @@ def execute_deferred_after_perform_callbacks(context)

interactor = interactor_class.new(context)
env = ActiveSupport::Callbacks::Filters::Environment.new(interactor, false, nil)
deferred_after_perform_callbacks.compile.invoke_after(env)
invoke_after(env)
interactor.send(:context)
end

private

if ActiveSupport.version >= '7.1'
def invoke_after(env)
deferred_after_perform_callbacks.compile(nil).invoke_after(env)
end
else
def invoke_after(env)
deferred_after_perform_callbacks.compile.invoke_after(env)
end
end

def init_deferred_after_perform_callbacks
after_callbacks_deferred = interactor_class.present? &&
interactor_class.after_callbacks_deferred_when_organized
Expand Down

0 comments on commit bd014d9

Please sign in to comment.