waistband 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/waistband/query.rb +2 -3
- data/lib/waistband/version.rb +1 -1
- metadata +1 -1
data/lib/waistband/query.rb
CHANGED
@@ -11,9 +11,10 @@ module Waistband
|
|
11
11
|
@index = index
|
12
12
|
@page = (options[:page] || 1).to_i
|
13
13
|
@page_size = (options[:page_size] || 20).to_i
|
14
|
+
prepare
|
14
15
|
end
|
15
16
|
|
16
|
-
def prepare(hash)
|
17
|
+
def prepare(hash = {})
|
17
18
|
@hash = hash.with_indifferent_access
|
18
19
|
self
|
19
20
|
end
|
@@ -21,8 +22,6 @@ module Waistband
|
|
21
22
|
private
|
22
23
|
|
23
24
|
def to_hash
|
24
|
-
raise "No query has been prepared yet!" unless @hash
|
25
|
-
|
26
25
|
@hash[:from] = from unless @hash[:from]
|
27
26
|
@hash[:size] = @page_size unless @hash[:size]
|
28
27
|
|
data/lib/waistband/version.rb
CHANGED