Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore http requests in models that save files to AWS using carrier_waive #24

Closed
jeniaefimov opened this issue Oct 1, 2019 · 2 comments

Comments

@jeniaefimov
Copy link

In project we have models with such lines:

mount_uploader :file, DocUploader
mount_base64_uploader :signature, SignatureUploader

Isolator raises exception on all such models when find Model.create(file: file) or Model.update(file: file)

I tried to add these models and uploaders to .isolator_todo.yml, but still getting exceptions.

May be I can ignore such situation using Isolator.adapters.http.ignore_if, but I don't understand the trigger on which this condition may rely.

Can anyone help with this question?

@palkan
Copy link
Owner

palkan commented Oct 2, 2019

I tried to add these models and uploaders to .isolator_todo.yml, but still getting exceptions.

.isolator_todo.yml could only work with your app's code; but in your case, http requests are made from the gem; so, it's not an option.

You should be able to use ignore_if. You can access the violating method arguments in it:

Isolator.adapters.http.ignore_if do |*args|
  aws_request?(args)
end

You need to figure out how to distinguish AWS requests from others.

Another option could be is to check that you're inside the carrier_wave gem by checking for caller_locations.

@jeniaefimov
Copy link
Author

@palkan thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants