quest_search 0.0.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- end_results = []
46
+ paginated_results = []
47
47
 
48
48
  results.each_with_index do |r, index|
49
- if index == offset_ends
50
- break
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
- end_results
54
+ paginated_results
59
55
  end
60
56
  end
61
57
 
@@ -1,3 +1,3 @@
1
1
  module QuestSearch
2
- VERSION = "0.0.8"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quest_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: