From b60b0e10d06cc11e7d03668e476024b2c11fe827 Mon Sep 17 00:00:00 2001 From: Sagiv Date: Mon, 20 Apr 2015 14:47:20 -0400 Subject: [PATCH] add ReachableDictionary#limit_with_where to return a loaded scope --- lib/cequel/model/readable_dictionary.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cequel/model/readable_dictionary.rb b/lib/cequel/model/readable_dictionary.rb index 1ec8243..e4addad 100644 --- a/lib/cequel/model/readable_dictionary.rb +++ b/lib/cequel/model/readable_dictionary.rb @@ -79,6 +79,10 @@ def load(*keys) fully_load_scope(column_family.where(key_alias.to_s => keys)) end + def limit_with_where(limit, args) + fully_load_scope(column_family.limit(limit).where(*args)) + end + private def find_in_batches(batch_size)