Closed natesalisbury closed 4 years ago
@awood45 any feedback for these changes?
Sorry, haven't had a chance to review yet. It's on my work backlog.
No worries, thanks!
Was interested in using default values today and was surprised that this was not the behavior. In fact, would this PR solve a bug? I am not sure why storing a proc as a string would be the expected results?
Like, is this the expected way to use a default value for a hash key?
class MyModel
include Aws::Record
string_attr :prefix, hash_key: true
string_attr :description
def initialize(*args)
super
self.prefix ||= new_prefix
end
# ...
end
Apologies it has taken us so long to get around to reviewing this change. Overall it looks good, however, in ItemData#populate_default_values, the default_value lambda will end up getting called twice.
I'm happy to fix that later today.
Improvements to using a lambda as a default value: