lib/sn_foil/contexts/destroy_context.rb in snfoil-0.4.3 vs lib/sn_foil/contexts/destroy_context.rb in snfoil-0.5.0

- old
+ new

@@ -15,11 +15,11 @@ end class_methods do attr_reader :i_setup_destroy_hooks, :i_before_destroy_hooks, :i_after_destroy_hooks, :i_after_destroy_success_hooks, :i_after_destroy_failure_hooks - def destroy(id:, user: nil, **options) - new(user).destroy(**options, id: id) + def destroy(id:, entity: nil, **options) + new(entity).destroy(**options, id: id) end def setup_destroy(method = nil, **options, &block) raise ArgumentError, '#setup_destroy requires either a method name or a block' if method.nil? && block.nil?