Dynamoid
Dynamoid copied to clipboard
.where query arguments are not dumped
Here is an rspec test demonstrating the issue
address = Address.create(:city => 'Seattle', :deliverable => true)
found = Address.find(address.id)
found.deliverable.should eq true
# PASSES in head
found = Address.where(:deliverable => 't').all
found.should eq [address]
# FAILS
found = Address.where(:deliverable => true).all
found.should eq [address]
# PASSES in head
found = Address.where(:updated_at => address.updated_at.to_time.to_f).all
found.should eq [address]
# FAILS
found = Address.where(:updated_at => address.updated_at).all
found.should eq [address]
Dynamoid::Chain.where is not transforming the values into their dumped versions. This makes for pretty ugly queries. Instead, it could call a dump_field in Dynamoid::Persistence, however it is private at the moment: https://github.com/Veraticus/Dynamoid/blob/master/lib/dynamoid/persistence.rb#L222