Dynamoid icon indicating copy to clipboard operation
Dynamoid copied to clipboard

find_all_by_* methods do not support query options

Open luxx opened this issue 13 years ago • 1 comments

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}

luxx avatar Jan 23 '13 20:01 luxx

I think this was somehow fixed in the meanwhile. I am using something similar and it works just fine.

stefanneculai avatar Jun 16 '13 20:06 stefanneculai