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

Fix bug when reading content_type from a CSV object linked to a file #2562

Merged

Conversation

pjmartorell
Copy link
Contributor

Resolves #2559

In my previous PR I mistakenly passed the file argument to Marcel::Magic.by_path instead of path. This was not an issue in the majority of cases (File objects work properly) but not for a CSV, which raises a TypeError Exception: no implicit conversion of CSV into String. Since all tests were passing, this bug passed inadvertently. I added a new test to ensure it does not happen again.

@pjmartorell
Copy link
Contributor Author

@mshibuya could you take a look at this fix?

@mshibuya mshibuya merged commit 1c7bdd2 into carrierwaveuploader:master Apr 17, 2021
@mshibuya
Copy link
Member

Looks great, thanks!

@olbrich
Copy link

olbrich commented Apr 26, 2021

I think this bug also causes failures in the case where the file is empty or the by_path method otherwise returns nil. It would be nice to get this released.

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

Successfully merging this pull request may close these issues.

"No implicit conversion" error with v2.2.1
3 participants