-
Notifications
You must be signed in to change notification settings - Fork 41
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
Default value lambda improvements #72
Conversation
Changes Unknown when pulling 08bd9ff on natesalisbury:default_value_lambdas into ** on aws:master**. |
2 similar comments
Changes Unknown when pulling 08bd9ff on natesalisbury:default_value_lambdas into ** on aws:master**. |
Changes Unknown when pulling 08bd9ff on natesalisbury:default_value_lambdas into ** on aws:master**. |
Changes Unknown when pulling b5e0e8f on natesalisbury:default_value_lambdas into ** on aws:master**. |
@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: