kaminari-neo4j 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kaminari/neo4j/paginated.rb +1 -15
- data/lib/kaminari/neo4j/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef076f46be70a411c7bd452743dc70dcc388918
|
4
|
+
data.tar.gz: 27fd8e6ad95ac86031c67c34ebee8701eac9d4df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7c625ff6d653817f7fd1069a8d8966078c22ceb2af0fca92fb97c6de43b39b68a9a6a9defcbb6573b7bc05327be0d550082d3a300254edcdde64bf73d975fe
|
7
|
+
data.tar.gz: 3f3cfcb252cde749d24f1b8ab7120071b73a1bd1de2cfc45fc0187bc10ad8c28c8e10b7b5aa2fcb95fc93dff7d702d59c1d4debb095af3ac9bc648bdb9fad15e
|
@@ -19,12 +19,7 @@ module Kaminari
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def total
|
22
|
-
|
23
|
-
if source.instance_of?(::Neo4j::Core::Query)
|
24
|
-
source.reorder.with("#{target} as #{target}").pluck("COUNT(#{target})").first
|
25
|
-
else
|
26
|
-
source.count
|
27
|
-
end
|
22
|
+
source.count
|
28
23
|
end
|
29
24
|
|
30
25
|
def items
|
@@ -35,10 +30,6 @@ module Kaminari
|
|
35
30
|
new(source, page, per_page)
|
36
31
|
end
|
37
32
|
|
38
|
-
def target(source)
|
39
|
-
source.instance_of?(::Neo4j::Core::Query) ? return_var : source.identity
|
40
|
-
end
|
41
|
-
|
42
33
|
def per(num)
|
43
34
|
self.class.create_from(source, current_page, num)
|
44
35
|
end
|
@@ -48,11 +39,6 @@ module Kaminari
|
|
48
39
|
self
|
49
40
|
end
|
50
41
|
|
51
|
-
def return_var
|
52
|
-
clause = source.instance_variable_get('@clauses').find { |c| c.is_a?(::Neo4j::Core::QueryClauses::ReturnClause) }
|
53
|
-
clause.instance_variable_get('@arg')
|
54
|
-
end
|
55
|
-
|
56
42
|
def to_ary
|
57
43
|
items.to_a
|
58
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari-neo4j
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dieter Pisarewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|