-
Benachrichtigungen
You must be signed in to change notification settings - Fork 285
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
generate_transformation_string destructively eats the transformation key out of the hash #61
Kommentare
The generate_transformation_string is an internal method and is not intended for use externally. It destructively updates the received hash parameter as indicated by the comment above the method. Do you require a helper method for calling this method directly? Something that cannot be done with the cloudinary_url helper methods? |
OK, now I understand what you are referring too. There is indeed a problem in Cloudinary::Uploader calling generate_transformation_string without cloning it fix. We will issue a fix shortly. |
Yep that's what I mean. fyi it's called from Attachinary via
Which then calls the method in question, which destructively modifies options[:cloudinary] I would say even if the method is "internal" you should strive for idempotence and not destroying incoming parameters. It leads to extremely hard to track down bugs. And since it's not truly internal because it's public and called by other public methods, you have the potential to leak out very dangerous effects into calling code. |
…port for rails4 sass asset path integration, Flag to prevent cloudinary from downloading remote urls directly, Issue #61 build_upload_params destructively updates options
I will soon have a pull request with tests that shows this bug and provides a fix. The generate_transformation_string method eats the 'transformatoin' key from the hash passed into it. If you're using attachinary, this hash is also used in the front end to generate form data, so the form ends up without the transformation key in it.
Logged as Ticket 8567 in the cloudinary support system. Additionally, after reading through the cloudinary gem code, I am not inspired with confidence to the backend service. We can do better than 50 lines long methods :)
The text was updated successfully, but these errors were encountered: