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

dynamic resource methods with float values are being ignored #425

Closed
sathish-progress opened this issue Aug 4, 2021 · 0 comments · Fixed by #424
Closed

dynamic resource methods with float values are being ignored #425

sathish-progress opened this issue Aug 4, 2021 · 0 comments · Fixed by #424

Comments

@sathish-progress
Copy link
Contributor

Describe the problem

if properties attribute for any azure resource has float values than that attribute is being ignored while creating instance methods

Executing the below in context of an Azure resource,

response =  { properties: { scalingFactor: 1.0 } }

resource.create_resource_methods(response)

expected:

resource.properties.scalingFactor => 1.0 

actual:

resource.properties.scalingFactor => NullResponse

Possible Solution

allow create_resource_methods to support Float and Bignum types
long term support is to include all Numeric types

snippet with issue

case value.class.to_s
    when 'String', 'Integer', 'TrueClass', 'FalseClass', 'Fixnum', 'Time'

temporary solution:

case value.class.to_s
    when 'String', 'Integer', 'TrueClass', 'FalseClass', 'Fixnum', 'Time', 'Bignum', 'Float'

Long term solution:

case value
    when String, Numeric, TrueClass, FalseClass, Time
@sathish-progress sathish-progress linked a pull request Aug 4, 2021 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant