class FindTestTable
include Aws::Record
string_attr :hash, hash_key: true, database_attribute_name: :hk
string_attr :range, range_key: true, database_attribute_name: :rk
end
This class will work for creating new items and saving them, but if you run the following, you'll have a problem:
item = FindTestTable.find(hash: 'validh', range: 'validr')
item.to_h # will have nil values for both keys
This works correctly if you stringify the values, as is documented:
class FindTestTable
include Aws::Record
string_attr :hash, hash_key: true, database_attribute_name: 'hk'
string_attr :range, range_key: true, database_attribute_name: 'rk'
end
I think this should be enhanced to properly read from databases when you use symbols for the database_attribute_name, it was likely an oversight on my part that it didn't to begin with. I also think this is likely a decent first issue for someone looking to get familiar with the deserialization logic.
To reproduce, consider the following class:
This class will work for creating new items and saving them, but if you run the following, you'll have a problem:
This works correctly if you stringify the values, as is documented:
I think this should be enhanced to properly read from databases when you use symbols for the database_attribute_name, it was likely an oversight on my part that it didn't to begin with. I also think this is likely a decent first issue for someone looking to get familiar with the deserialization logic.