edge 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/edge/forest.rb +4 -3
- data/lib/edge/version.rb +1 -1
- metadata +3 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe550a31afecff13aad7e57f96d370bfa89e914
|
4
|
+
data.tar.gz: ee8c1457895a5bfb1fd2a6478ce52ee64a600a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5d301a74705822566be807f9e65ce0699450a125d9268ce1a8e3729e94846ab19deaa7faa68303c45d516df2c7de8b351aa638381cac0b4c86b05a5ca9c2f83
|
7
|
+
data.tar.gz: bb0bd66741d85b26057fb90d4d2ba4d39dad1b59fec902ad80daccc4490f186079da87697426d6fac358e711ce330c32e5382fbc32c0e6b216be6a1bdba97187
|
data/CHANGELOG.md
CHANGED
data/lib/edge/forest.rb
CHANGED
@@ -20,14 +20,15 @@ module Edge
|
|
20
20
|
:foreign_key => forest_foreign_key
|
21
21
|
}
|
22
22
|
|
23
|
-
belongs_to :parent, common_options
|
23
|
+
belongs_to :parent, common_options.merge(inverse_of: :children)
|
24
24
|
|
25
25
|
if forest_order
|
26
|
-
has_many :children, -> { order(forest_order) }, common_options
|
26
|
+
has_many :children, -> { order(forest_order) }, common_options.merge(inverse_of: :parent)
|
27
27
|
else
|
28
|
-
has_many :children, common_options
|
28
|
+
has_many :children, common_options.merge(inverse_of: :parent)
|
29
29
|
end
|
30
30
|
|
31
|
+
|
31
32
|
scope :root, -> { where(forest_foreign_key => nil) }
|
32
33
|
|
33
34
|
include Edge::Forest::InstanceMethods
|
data/lib/edge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -145,9 +145,4 @@ signing_key:
|
|
145
145
|
specification_version: 4
|
146
146
|
summary: Graph functionality for ActiveRecord. Provides tree/forest modeling structure
|
147
147
|
that can load entire trees in a single query.
|
148
|
-
test_files:
|
149
|
-
- spec/database.yml
|
150
|
-
- spec/database_structure.sql
|
151
|
-
- spec/forest_spec.rb
|
152
|
-
- spec/spec_helper.rb
|
153
|
-
has_rdoc:
|
148
|
+
test_files: []
|