acts_as_dag 2.0.0 → 2.0.1

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: 7cdf416ca036dc48217c3248d88ca65c9b18f5f7
4
- data.tar.gz: 2885cb66137fed85c3c8d4e5506525b37042ab08
3
+ metadata.gz: 2ef664650fe43597abf3351e148b8901a5a93fbc
4
+ data.tar.gz: e0815bacf6b301658b2f09ea4dd3145c77c53ef1
5
5
  SHA512:
6
- metadata.gz: c913c0ea39c240b172ca8a2def8f58641b5b568cf66cd612a1872c94ee5272eb5a3b1711120c17ab3caf871ce4edb25400610c88a509fc9a3bafbfb536545d57
7
- data.tar.gz: bc6587a3699810974d7d95a564c8986356e3b3889bf2d9baf1ac174d12bdf7dfd5cd253695033b14e5107be06022c2dbcfded1feb2f1df1028916f46dd425d53
6
+ metadata.gz: 64d34f683f65f295c96b7673f47fd070fa5fb14150349ee2c3232bd81dce0523c20777d76f07e7f303e5de3ecd0257724b73672fc5635860726bb78a1b33738f
7
+ data.tar.gz: 604d62acc24f1d45c81672a9f757218cdd2d05a4c368edd6eece10218e089ace703d235a17e7b8e5a57d07bf0e35ad6aa5d26a5997e5066117ef9fc176cc4603
data/README.md CHANGED
@@ -133,6 +133,8 @@ depth Return the depth of the node, root nodes are at depth 0
133
133
  siblings_of(node) Siblings of node, node can be either a record or an id
134
134
  ```
135
135
 
136
+ ### Remove deprecated functionality
137
+ This gem was extracted from an early project. Functionality required for that project found its way into the gem, but is only incidentally related to the generation of the DAG. This has been moved to the ActsAsDag::Deprecated module, and will be removed in a future version.
136
138
 
137
139
  ## Credits
138
140
 
@@ -63,17 +63,17 @@ module ActsAsDAG
63
63
  # \ /
64
64
  # D
65
65
  #
66
- has_many :ancestors, lambda { order("#{descendant_class.table_name}.distance DESC") }, :through => :ancestor_links, :source => :ancestor
67
- has_many :descendants, lambda { order("#{descendant_class.table_name}.distance ASC") }, :through => :descendant_links, :source => :descendant
66
+ has_many :ancestors, :through => :ancestor_links, :source => :ancestor
67
+ has_many :descendants, :through => :descendant_links, :source => :descendant
68
68
 
69
- has_many :path, lambda { order("#{descendant_class.table_name}.distance DESC") }, :through => :path_links, :source => :ancestor
70
- has_many :subtree, lambda { order("#{descendant_class.table_name}.distance ASC") }, :through => :subtree_links, :source => :descendant
69
+ has_many :path, :through => :path_links, :source => :ancestor
70
+ has_many :subtree, :through => :subtree_links, :source => :descendant
71
71
 
72
- has_many :ancestor_links, lambda { where(options[:link_conditions]).where("ancestor_id != descendant_id") }, :class_name => descendant_class, :foreign_key => 'descendant_id'
73
- has_many :descendant_links, lambda { where(options[:link_conditions]).where("descendant_id != ancestor_id") }, :class_name => descendant_class, :foreign_key => 'ancestor_id'
72
+ has_many :ancestor_links, lambda { where(options[:link_conditions]).where("ancestor_id != descendant_id").order("distance DESC") }, :class_name => descendant_class, :foreign_key => 'descendant_id'
73
+ has_many :descendant_links, lambda { where(options[:link_conditions]).where("descendant_id != ancestor_id").order("distance ASC") }, :class_name => descendant_class, :foreign_key => 'ancestor_id'
74
74
 
75
- has_many :path_links, lambda { where options[:link_conditions] }, :class_name => descendant_class, :foreign_key => 'descendant_id', :dependent => :delete_all
76
- has_many :subtree_links, lambda { where options[:link_conditions] }, :class_name => descendant_class, :foreign_key => 'ancestor_id', :dependent => :delete_all
75
+ has_many :path_links, lambda { where(options[:link_conditions]).order("distance DESC") }, :class_name => descendant_class, :foreign_key => 'descendant_id', :dependent => :delete_all
76
+ has_many :subtree_links, lambda { where(options[:link_conditions]).order("distance ASC") }, :class_name => descendant_class, :foreign_key => 'ancestor_id', :dependent => :delete_all
77
77
 
78
78
  has_many :parents, :through => :parent_links, :source => :parent
79
79
  has_many :children, :through => :child_links, :source => :child
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_dag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Jakobsen
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubyforge_project:
75
- rubygems_version: 2.2.2
75
+ rubygems_version: 2.4.6
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Adds directed acyclic graph functionality to ActiveRecord.