ltree_hierarchy 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +22 -36
- data/README.md +2 -2
- data/lib/ltree_hierarchy/hierarchy.rb +14 -3
- data/lib/ltree_hierarchy/version.rb +1 -1
- data/ltree_hierarchy-0.0.7.gem +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 946448c6b809825223af23ae122c5bb09804eee6
|
4
|
+
data.tar.gz: ced0477c73a25355c32d47cb39586fba159f7053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13951ae121ca678cde04bc7c8aa7b7907acc3e500d42f95f596073375fedf705062629536d008b73c2824e167fd7960af0c353e4536a017a387663bd6c462382
|
7
|
+
data.tar.gz: 6a7aaf0aafbc5329db9f98aeccb98ec9894205abc62035cd2b6ea11b4c6363198ddf68301f0522c418528b35fa489e1ed3c28232c831ce41efb619308d34f14d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,52 +1,38 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ltree_hierarchy (0.0.
|
5
|
-
activerecord (>= 3.1
|
6
|
-
pg
|
4
|
+
ltree_hierarchy (0.0.7)
|
5
|
+
activerecord (>= 3.1)
|
6
|
+
pg (~> 0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (
|
12
|
-
activesupport (=
|
13
|
-
builder (~> 3.
|
14
|
-
activerecord (
|
15
|
-
activemodel (=
|
16
|
-
activesupport (=
|
17
|
-
arel (~>
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
arel (6.0.0)
|
25
|
-
builder (3.2.2)
|
26
|
-
coderay (1.1.0)
|
11
|
+
activemodel (3.2.21)
|
12
|
+
activesupport (= 3.2.21)
|
13
|
+
builder (~> 3.0.0)
|
14
|
+
activerecord (3.2.21)
|
15
|
+
activemodel (= 3.2.21)
|
16
|
+
activesupport (= 3.2.21)
|
17
|
+
arel (~> 3.0.2)
|
18
|
+
tzinfo (~> 0.3.29)
|
19
|
+
activesupport (3.2.21)
|
20
|
+
i18n (~> 0.6, >= 0.6.4)
|
21
|
+
multi_json (~> 1.0)
|
22
|
+
arel (3.0.3)
|
23
|
+
builder (3.0.4)
|
27
24
|
i18n (0.7.0)
|
28
|
-
|
29
|
-
|
30
|
-
minitest (5.6.1)
|
25
|
+
minitest (5.7.0)
|
26
|
+
multi_json (1.11.0)
|
31
27
|
pg (0.18.2)
|
32
|
-
pry (0.10.1)
|
33
|
-
coderay (~> 1.1.0)
|
34
|
-
method_source (~> 0.8.1)
|
35
|
-
slop (~> 3.4)
|
36
|
-
pry-nav (0.2.4)
|
37
|
-
pry (>= 0.9.10, < 0.11.0)
|
38
28
|
rake (10.4.2)
|
39
|
-
|
40
|
-
thread_safe (0.3.5)
|
41
|
-
tzinfo (1.2.2)
|
42
|
-
thread_safe (~> 0.1)
|
29
|
+
tzinfo (0.3.44)
|
43
30
|
|
44
31
|
PLATFORMS
|
45
32
|
ruby
|
46
33
|
|
47
34
|
DEPENDENCIES
|
35
|
+
activerecord (~> 3.2)
|
48
36
|
ltree_hierarchy!
|
49
|
-
minitest
|
50
|
-
|
51
|
-
pry-nav
|
52
|
-
rake
|
37
|
+
minitest (>= 4.2)
|
38
|
+
rake (~> 10.4)
|
data/README.md
CHANGED
@@ -173,13 +173,24 @@ module Ltree
|
|
173
173
|
end
|
174
174
|
alias :and_siblings :self_and_siblings
|
175
175
|
|
176
|
-
def
|
176
|
+
def descendants
|
177
177
|
ltree_scope.where("#{ltree_path_column} <@ ? AND #{ltree_fragment_column} != ?", ltree_path, ltree_fragment)
|
178
178
|
end
|
179
179
|
|
180
|
-
def
|
180
|
+
def descendents
|
181
|
+
warn 'This method has been deprecated. Use #descendants instead'
|
182
|
+
descendants
|
183
|
+
end
|
184
|
+
|
185
|
+
def self_and_descendants
|
181
186
|
ltree_scope.where("#{ltree_path_column} <@ ?", ltree_path)
|
182
187
|
end
|
188
|
+
alias :and_descendants :self_and_descendants
|
189
|
+
|
190
|
+
def self_and_descendents
|
191
|
+
warn 'This method has been deprecated. Use #self_and_descendants instead'
|
192
|
+
self_and_descendants
|
193
|
+
end
|
183
194
|
alias :and_descendents :self_and_descendents
|
184
195
|
|
185
196
|
def children
|
@@ -192,7 +203,7 @@ module Ltree
|
|
192
203
|
alias :and_children :self_and_children
|
193
204
|
|
194
205
|
def leaves
|
195
|
-
|
206
|
+
descendants.leaves
|
196
207
|
end
|
197
208
|
end
|
198
209
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ltree_hierarchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Worley
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pg
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/ltree_hierarchy.rb
|
87
87
|
- lib/ltree_hierarchy/hierarchy.rb
|
88
88
|
- lib/ltree_hierarchy/version.rb
|
89
|
+
- ltree_hierarchy-0.0.7.gem
|
89
90
|
- ltree_hierarchy.gemspec
|
90
91
|
homepage: https://github.com/Leadformance/ltree_hierarchy
|
91
92
|
licenses:
|
@@ -112,3 +113,4 @@ signing_key:
|
|
112
113
|
specification_version: 4
|
113
114
|
summary: Organize ActiveRecord models into a tree using PostgreSQL's ltree datatype
|
114
115
|
test_files: []
|
116
|
+
has_rdoc:
|