From cc5014463238d730bc7c7f0d86cfeee74105053e Mon Sep 17 00:00:00 2001 From: Sagiv Date: Mon, 20 Apr 2015 18:51:49 -0400 Subject: [PATCH] Add limit_with_where - a way to query model and get results in formatted way --- 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 579c83a..a3335a0 100644 --- a/lib/cequel/model/readable_dictionary.rb +++ b/lib/cequel/model/readable_dictionary.rb @@ -106,6 +106,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 fully_load_scope(scope)