ohm-sorted 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/lib/ohm/sorted.rb +4 -1
- data/ohm-sorted.gemspec +1 -1
- data/test/sorted_test.rb +2 -2
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDNmZTcwMWNmNjBkNmExODdkMDc0MWFlM2M1NjAyZGZmZWI5YWRlMg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 355f7018df42de77b3733ed309257ac21a50e9df
|
4
|
+
data.tar.gz: 512e39ffdcea42c36d3ed2ecdaa3b3f9fa7ba7fd
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
OWI3NmU2MzljYzFlNzZkYWVhYmZlOTYzN2I1ODQ2Y2I3NTE2YWViZmEzMmIy
|
11
|
-
YWRhYzliYzZmMTVmZjQyYmVmMGM2OWE5ZWU0NGVkMmIwODNmZDc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YzA4ZWNmOTM3OGU1OGUxOTY4NTcxYjZlNmU2ODI5NGZiMmJlOTRmZDI1ZDBj
|
14
|
-
YzM3MjViZWIyZDA4ZDc3MTQ3MDVjOTcwNTZkMjNhYTUzODIwYzkwYWJlNTcy
|
15
|
-
MjJhYTFlMWUzMjBiOGU3OTgxMjY1ODdkN2E1ZTQzMzEyNmRlZjM=
|
6
|
+
metadata.gz: 71219e4bbd9f003f58bbfb8631a25e9e799155cf442d316ce6fdb648bf1ed6afd0970fd2c78037b5a50fe1ae553cc6bcd17d99b4a24a1ca0807af16aa27b4c03
|
7
|
+
data.tar.gz: a2ab1aa904a6195d84a0e1ca624952036aff42dd03293c9eef51a2a8618afbf74e4988fa3ed42de9b69905f5c7ec43e88e601c7c827c4b305cf532220900cdf5
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/ohm/sorted.rb
CHANGED
@@ -219,7 +219,10 @@ module Ohm
|
|
219
219
|
|
220
220
|
def add_sorted_indices
|
221
221
|
update_sorted_indices do |key, attribute, options|
|
222
|
-
|
222
|
+
attr = send(attribute)
|
223
|
+
next if attr.nil?
|
224
|
+
|
225
|
+
score = attr.to_f
|
223
226
|
db.zadd(key, score, id)
|
224
227
|
end
|
225
228
|
end
|
data/ohm-sorted.gemspec
CHANGED
data/test/sorted_test.rb
CHANGED
@@ -105,10 +105,10 @@ class SortedTest < Test::Unit::TestCase
|
|
105
105
|
assert_equal [], sorted_set.to_a
|
106
106
|
end
|
107
107
|
|
108
|
-
def
|
108
|
+
def test_does_not_index_nil
|
109
109
|
post = Post.create(status: "draft")
|
110
110
|
sorted_set = Post.sorted_find(:order, status: "draft")
|
111
|
-
assert_equal [
|
111
|
+
assert_equal [], sorted_set.to_a
|
112
112
|
end
|
113
113
|
|
114
114
|
def test_sorted_find_invalid
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohm-sorted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Bond
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ohm
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ohm-contrib
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: An plugin for Ohm that lets you create sorted indices.
|
@@ -58,8 +58,8 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
-
- .gitignore
|
62
|
-
- .travis.yml
|
61
|
+
- ".gitignore"
|
62
|
+
- ".travis.yml"
|
63
63
|
- Appraisals
|
64
64
|
- CHANGELOG.md
|
65
65
|
- Gemfile
|
@@ -80,17 +80,17 @@ require_paths:
|
|
80
80
|
- lib
|
81
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.2.
|
93
|
+
rubygems_version: 2.2.2
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Sorted indices for Ohm.
|