quest_search 0.0.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/quest_search/quest_search_on.rb +6 -10
- data/lib/quest_search/version.rb +1 -1
- metadata +1 -1
@@ -34,28 +34,24 @@ module QuestSearch
|
|
34
34
|
results = self.where(conditions).order(@order)
|
35
35
|
|
36
36
|
if !sort
|
37
|
-
results.sort do |a, b|
|
37
|
+
results = results.sort do |a, b|
|
38
38
|
b.points_for(query) <=> a.points_for(query)
|
39
39
|
end
|
40
40
|
else
|
41
|
-
results.each do |r|
|
41
|
+
results = results.each do |r|
|
42
42
|
r.points_for(query)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
paginated_results = []
|
47
47
|
|
48
48
|
results.each_with_index do |r, index|
|
49
|
-
if index
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
if index >= offset
|
54
|
-
end_results.push r
|
49
|
+
if index >= offset && index < offset_ends
|
50
|
+
paginated_results.push r
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
58
|
-
|
54
|
+
paginated_results
|
59
55
|
end
|
60
56
|
end
|
61
57
|
|
data/lib/quest_search/version.rb
CHANGED