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

- old
+ new

@@ -15,11 +15,11 @@ end class_methods do attr_reader :i_setup_create_hooks, :i_before_create_hooks, :i_after_create_hooks, :i_after_create_success_hooks, :i_after_create_failure_hooks - def create(params:, user: nil, **options) - new(user).create(**options, params: params) + def create(params:, entity: nil, **options) + new(entity).create(**options, params: params) end def setup_create(method = nil, **options, &block) raise ArgumentError, '#setup_create requires either a method name or a block' if method.nil? && block.nil?