aws / aws-sdk-ruby-record

Official repository for the aws-record gem, an abstraction for Amazon DynamoDB.
Apache License 2.0
318 stars 41 forks source link

Suppress unhelpful warnings on Ruby 2.7 #112

Closed clowder closed 3 years ago

clowder commented 3 years ago

Calling [Attribute#default_value] on record initialized with a :default_value triggered the following warning:

instance variable @default_value_or_lambda not initialized

The warning's not particularly useful as the caller will simply get a nil and carry on anyway[1]. By setting the variable to nil for records without a :default_value we maintain this behaviour and suppress the warning.

[1]: Later versions of Ruby simply suppress this warning

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

alextwoods commented 3 years ago

These look good - thanks for submitting!