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

aws_attributes broken for ActiveSupport::OrderedOptions #180

Open
kapcod opened this issue Apr 2, 2024 · 0 comments
Open

aws_attributes broken for ActiveSupport::OrderedOptions #180

kapcod opened this issue Apr 2, 2024 · 0 comments

Comments

@kapcod
Copy link

kapcod commented Apr 2, 2024

Hello.

A common way to load CarrierWave config is from yml file using Rails.application.config_for method. This method returns object of class ActiveSupport::OrderedOptions which behaves similar to OpenStruct but responds to .call and returns nil for .call.

This line

attributes.respond_to?(:call) ? attributes.call : attributes

uses respond_to?(:call) to check if aws_attributes is proc which is broken in this case. I suggest checking it using is_a?(Proc) which will be more correct. On the other side it will break the "duck type" approach, so not sure what's the right solution here.

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

1 participant