simple_nested_set 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,9 @@ module SimpleNestedSet
|
|
6
6
|
@_nested_set ||= nested_set_class.new(self)
|
7
7
|
end
|
8
8
|
|
9
|
-
def attributes=(attributes)
|
9
|
+
def attributes=(attributes, *args)
|
10
10
|
@_nested_set_attributes = nested_set_class.extract_attributes!(attributes)
|
11
|
-
super(attributes)
|
11
|
+
super(attributes, *args)
|
12
12
|
end
|
13
13
|
|
14
14
|
# recursively populates the parent and children associations of self and
|
@@ -20,7 +20,7 @@ module SimpleNestedSet
|
|
20
20
|
node.move_to_right_of(left_id)
|
21
21
|
elsif right_id && right_id != node.id
|
22
22
|
node.move_to_left_of(right_id)
|
23
|
-
elsif parent_id != node.parent_id
|
23
|
+
elsif parent_id && parent_id != node.parent_id
|
24
24
|
node.move_to_child_of(parent_id)
|
25
25
|
end
|
26
26
|
end
|
@@ -44,7 +44,7 @@ module SimpleNestedSet
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def normalize_attributes!
|
47
|
-
attributes.symbolize_keys!
|
47
|
+
attributes.symbolize_keys! if attributes.respond_to?(:symbolize_keys!)
|
48
48
|
attributes.each { |key, value| attributes[key] = nil if value == 'null' }
|
49
49
|
|
50
50
|
[:parent, :left, :right].each do |key|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_nested_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sven Fuchs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|