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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51ee41eeaece2350371b456fea8be4a8e8a88c10
4
- data.tar.gz: 9cd14a961bd767b515cfbbb805e815f90d9900a7
3
+ metadata.gz: 1fe550a31afecff13aad7e57f96d370bfa89e914
4
+ data.tar.gz: ee8c1457895a5bfb1fd2a6478ce52ee64a600a62
5
5
  SHA512:
6
- metadata.gz: dbe08d2bb70acdd203b2e32d98e2f7a3088285d7727051935762a2f7c59b7c41513d6300e31c05e42041d1f31c08ac8556c16390bf8ae4abebc35077e56d2337
7
- data.tar.gz: 8c87b4c64580afa7ae98406a70e00309c79137bb1d8a5d83c08b80244292b142578e37d8059664c8f855d5534adb43d33f8c4986c235ffbdd7590e07378cf75c
6
+ metadata.gz: a5d301a74705822566be807f9e65ce0699450a125d9268ce1a8e3729e94846ab19deaa7faa68303c45d516df2c7de8b351aa638381cac0b4c86b05a5ca9c2f83
7
+ data.tar.gz: bb0bd66741d85b26057fb90d4d2ba4d39dad1b59fec902ad80daccc4490f186079da87697426d6fac358e711ce330c32e5382fbc32c0e6b216be6a1bdba97187
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.3.2 (March 1, 2014)
2
+
3
+ * Set inverse_of on parent and children associations (Systho)
4
+
5
+ # 0.3.1 (February 7, 2014)
6
+
7
+ * Allow includes and with_descendents to work together (Systho)
8
+
1
9
  # 0.3.0 (December 17, 2013)
2
10
 
3
11
  * Rails 4 support
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
@@ -1,3 +1,3 @@
1
1
  module Edge
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-02-07 00:00:00.000000000 Z
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: []