Skip to content

Commit

Permalink
Fix generate_location method call to be Shrine 3.x and Ruby 3.x compl…
Browse files Browse the repository at this point in the history
…iant
  • Loading branch information
texpert committed May 15, 2023
1 parent 949dbe8 commit cdb16dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/shrine/plugins/aws_lambda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def function_available?(function)
end

def prepare_assembly(assembly, cached_file, context)
assembly[:path] = store.generate_location(cached_file, context)
assembly[:path] = store.generate_location(cached_file, metadata: cached_file.metadata, context: context)
assembly[:storages].each do |s|
upload_options = get_upload_options(cached_file, context, s)
s[1][:upload_options] = upload_options if upload_options
Expand Down
5 changes: 3 additions & 2 deletions spec/shrine/plugins/aws_lambda_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ def lambda_process_versions(io, context)
expect(LambdaUploader::Attacher).to receive(:retrieve).and_call_original

expect_any_instance_of(LambdaUploader).to receive(:lambda_process_versions).and_call_original
allow_any_instance_of(Shrine::Plugins::AwsLambda::AttacherMethods).to receive(:prepare_assembly)
expect_any_instance_of(Shrine::Plugins::AwsLambda::AttacherMethods).to receive(:prepare_assembly)
allow_any_instance_of(Shrine::Plugins::AwsLambda::AttacherMethods).to receive(:get_upload_options)
expect_any_instance_of(Shrine).to receive(:generate_location).and_call_original
expect_any_instance_of(Shrine).to receive(:basic_location)

aws_lambda_client = Aws::Lambda::Client.new(stub_responses: true)
allow_any_instance_of(Shrine::Plugins::AwsLambda::AttacherMethods)
Expand Down

0 comments on commit cdb16dc

Please sign in to comment.