bolter 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bolter/searchable.rb +1 -1
- data/lib/bolter/sortable.rb +1 -1
- data/lib/bolter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43fa0d127dc6b6e16cda2a3e22db976da485a68b
|
4
|
+
data.tar.gz: 42f9c4a24ee34baa223556a24067985ea09f2dc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eae0e0cce04ea02fafee80ba751ea6c687edeaf87e5ada3b6a4bfe61e6d8ddf179586e4ac1d37d0b51032ef17dea73abff9dc460f3d8aa45c421c5228b099d56
|
7
|
+
data.tar.gz: 073d3e314f83566298c86226ec56a8e85022385da20abff1fdecc82b8221e6d1642a7b0c15e10ef64bbb01a7dc00bd1f48ebe58028a75aae8128da236849ed95
|
data/lib/bolter/searchable.rb
CHANGED
@@ -4,7 +4,7 @@ module Bolter
|
|
4
4
|
included do
|
5
5
|
cattr_reader :used_as_filters
|
6
6
|
def self.search(params = {}, options = {})
|
7
|
-
result = self.current_scope
|
7
|
+
result = self.current_scope || self
|
8
8
|
# Prepare params to search
|
9
9
|
search = (params || {}).clone.reject{|_,value| value.to_s.empty? }
|
10
10
|
# Apply filters
|
data/lib/bolter/sortable.rb
CHANGED
@@ -7,7 +7,7 @@ module Bolter
|
|
7
7
|
field, direction = sorting.split(':',2)
|
8
8
|
if self.attribute_names.include? field.to_s
|
9
9
|
if %W[asc desc].include? direction
|
10
|
-
return self.current_scope.reorder(Hash[field, direction])
|
10
|
+
return (self.current_scope || self).reorder(Hash[field, direction])
|
11
11
|
end
|
12
12
|
else
|
13
13
|
self.order({})
|
data/lib/bolter/version.rb
CHANGED