Dynamoid
Dynamoid copied to clipboard
find_all_by_* methods do not support query options
How do I pass query options in a find_all_by_* query? Seems they are not passing through to the underlying query
Comment.find_all_by_user_id_and_blog_id "1234", "1", limit: 1, scan_index_forward: true
Comment.find_all_by_user_id "1234", limit: 1, scan_index_forward: true
If I use query directly, it works as expected:
query_options {hash_value: "12345", scan_index_forward: true, limit: 1}
hash_attrs = Dynamoid::Adapter.adapter.query Comment.table_name, query_options
hash_attrs.map{|attrs| self.from_database attrs}
I think this was somehow fixed in the meanwhile. I am using something similar and it works just fine.