ActsAsFastNestedSet 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/acts_as_fast_nested_set.rb +6 -6
  2. metadata +9 -8
@@ -54,7 +54,7 @@ require 'active_record'
54
54
  module Adocca
55
55
  module Acts
56
56
  module ActsAsFastNestedSet
57
- VERSION = "0.1.3"
57
+ VERSION = "0.1.4"
58
58
 
59
59
  def self.append_features(base)
60
60
  super
@@ -103,10 +103,10 @@ module Adocca
103
103
  end
104
104
  module SingletonMethods
105
105
  def set_options(options)
106
- @@options = options
106
+ @options = options
107
107
  end
108
108
  def get_options
109
- @@options
109
+ @options
110
110
  end
111
111
  end
112
112
  module InstanceMethods
@@ -137,7 +137,7 @@ module Adocca
137
137
  def destroy_descendants
138
138
  self.class.connection.delete(
139
139
  self.class.sanitizeSQL(
140
- ["DELETE FROM comments WHERE node_id LIKE ? AND id != ?#{unique_with_and}",
140
+ ["DELETE FROM #{self.class.table_name} WHERE node_id LIKE ? AND id != ?#{unique_with_and}",
141
141
  "#{self.node_id}%", self.id] + unique_params))
142
142
  end
143
143
  #
@@ -210,7 +210,7 @@ module Adocca
210
210
 
211
211
  def next_node_id(parentNodeId = nil)
212
212
  if parentNodeId.nil?
213
- maxId = self.class.connection.select_value(self.class.sanitizeSQL(["SELECT MAX(node_id) FROM comments#{unique_with_where}"] + unique_params))
213
+ maxId = self.class.connection.select_value(self.class.sanitizeSQL(["SELECT MAX(node_id) FROM #{self.class.table_name}#{unique_with_where}"] + unique_params))
214
214
  if maxId.nil? # there are no other root nodes
215
215
  "AAAA"
216
216
  else # there are other root nodes
@@ -221,7 +221,7 @@ module Adocca
221
221
  end
222
222
  end
223
223
  else # this is not a root node
224
- maxId = self.class.connection.select_value(self.class.sanitizeSQL(["SELECT MAX(node_id) FROM comments WHERE node_id LIKE ?#{unique_with_and}", "#{parentNodeId}%"] + unique_params))
224
+ maxId = self.class.connection.select_value(self.class.sanitizeSQL(["SELECT MAX(node_id) FROM #{self.class.table_name} WHERE node_id LIKE ?#{unique_with_and}", "#{parentNodeId}%"] + unique_params))
225
225
  if maxId.nil? # there are no nodes like the parent
226
226
  raise "Cant find parent, no node with id '#{parentNodeId}'!"
227
227
  else # there are nodes like the parent
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: ActsAsFastNestedSet
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
7
- date: 2007-01-17 00:00:00 +01:00
6
+ version: 0.1.4
7
+ date: 2007-06-21 00:00:00 +02:00
8
8
  summary: Fast nested set, really fast!
9
9
  require_paths:
10
10
  - lib
11
11
  email: ryand-ruby@zenspider.com
12
12
  homepage: http://www.zenspider.com/ZSS/Products/ActsAsFastNestedSet/
13
13
  rubyforge_project: adocca_plugins
14
- description: Ryan Davis is too lazy to write a description
14
+ description: The author was too lazy to write a description
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - adocca Entertainment AB
30
31
  files:
@@ -49,20 +50,20 @@ requirements: []
49
50
 
50
51
  dependencies:
51
52
  - !ruby/object:Gem::Dependency
52
- name: hoe
53
+ name: AdoccaMemcache
53
54
  version_requirement:
54
55
  version_requirements: !ruby/object:Gem::Version::Requirement
55
56
  requirements:
56
57
  - - ">="
57
58
  - !ruby/object:Gem::Version
58
- version: 1.1.4
59
+ version: 0.1.4
59
60
  version:
60
61
  - !ruby/object:Gem::Dependency
61
- name: AdoccaMemcache
62
+ name: hoe
62
63
  version_requirement:
63
64
  version_requirements: !ruby/object:Gem::Version::Requirement
64
65
  requirements:
65
66
  - - ">="
66
67
  - !ruby/object:Gem::Version
67
- version: 0.1.4
68
+ version: 1.2.0
68
69
  version: