hierarchy-tree 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hierarchy_tree.rb +6 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c49580e82d4958c3aac779b9d6bc474db3f458312a56ae56f9340e5dd775544
4
- data.tar.gz: 706e5c3ffa57ae961aa0c571a2c0db16688baba490a3408f7a65023a9f84e101
3
+ metadata.gz: ddb0de6ef3ff8b267337c4b212fb79cc61882daeabdeed87f24ed8c6e2cf57a2
4
+ data.tar.gz: 2f9edaf7700263b9cb0258c3b78254d2860d5483379898ddab7a05d9eefa0d09
5
5
  SHA512:
6
- metadata.gz: '0916dff1eeca02e53a6be930ca62f55e52d4d717a057a9bd892a9297134354a86e2b2b1c9a8b5a2c5daf8d7e990bd17586dc0a7170d82c98a9e4bcfdf21a84bb'
7
- data.tar.gz: fe0c0bb82cf73cb06873290335b1d25c463d0fddafe4a6737e474941d87745accf3d8b568b35dbac9a97cef4bd1f3bfa4727ac2ba5b7a3e917450c79fb07df64
6
+ metadata.gz: a737550c58c67149a23afd9252bc5f357953c715b9a76274da6c6c6b599bdd5fa3a22bda025cbec8913ba48c7350d44a2fa384222533b7816fb8f385469fbd40
7
+ data.tar.gz: e2b5a61beed7165bb58e36edc90c86e27e0214fe85a27af2a2ea99cb3825c0c4916c8700b8b333d7fabf1431f0ba9eff4621f22c8afa3ec4fef4e6b4d6f9aeac
@@ -3,9 +3,9 @@ require 'active_support/core_ext/object/inclusion.rb'
3
3
 
4
4
  ################ Debug ################
5
5
  # gem cleanup hierarchy-tree
6
- # rm hierarchy-tree-0.3.2.gem
6
+ # rm hierarchy-tree-X.Y.Z.gem
7
7
  # gem build hierarchy_tree
8
- # gem install hierarchy-tree-0.3.3.gem
8
+ # gem install hierarchy-tree-X.Y.Z.gem
9
9
  # ruby -Itest test/test_hierarchy_tree.rb
10
10
 
11
11
  class Hierarchy
@@ -41,6 +41,8 @@ class Hierarchy
41
41
  current_path = current[:path]
42
42
 
43
43
  current_class.constantize.reflect_on_all_associations(:belongs_to).each do |relation|
44
+ next if relation.options[:polymorphic]
45
+
44
46
  next_class = relation.klass.to_s
45
47
  next_path = current_path + [relation.name]
46
48
 
@@ -71,6 +73,8 @@ class Hierarchy
71
73
  current_path = current[:path]
72
74
 
73
75
  current_class.reflect_on_all_associations(:belongs_to).each do |relation|
76
+ next if relation.options[:polymorphic]
77
+
74
78
  next_class = relation.klass
75
79
  next_path = current_path + [relation.name]
76
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hierarchy-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Cordeiro Costa