Veraticus / Dynamoid

Ruby ORM for Amazon's DynamoDB
http://joshsymonds.com/Dynamoid/
247 stars 83 forks source link

find_all_by_* methods do not support query options #100

Open luxx opened 11 years ago

luxx commented 11 years ago

How do I pass query options in a find_allby* 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}
stefanneculai commented 11 years ago

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