dm-is-nested_set 1.1.0.rc2 → 1.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/dm-is-nested_set.gemspec +6 -6
- data/lib/dm-is-nested_set/is/nested_set.rb +10 -4
- metadata +4 -4
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
|
|
5
5
|
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
6
6
|
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
7
7
|
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
|
-
DM_VERSION = '~> 1.1.0.
|
8
|
+
DM_VERSION = '~> 1.1.0.rc3'
|
9
9
|
DO_VERSION = '~> 0.10.2'
|
10
10
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
11
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.0.
|
1
|
+
1.1.0.rc3
|
data/dm-is-nested_set.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-is-nested_set}
|
8
|
-
s.version = "1.1.0.
|
8
|
+
s.version = "1.1.0.rc3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sindre Aarsaether"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-10}
|
13
13
|
s.description = %q{DataMapper plugin allowing the creation of nested sets from data models}
|
14
14
|
s.email = %q{sindre [a] identu [d] no}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.homepage = %q{http://github.com/datamapper/dm-is-nested_set}
|
37
37
|
s.require_paths = ["lib"]
|
38
38
|
s.rubyforge_project = %q{datamapper}
|
39
|
-
s.rubygems_version = %q{1.
|
39
|
+
s.rubygems_version = %q{1.6.2}
|
40
40
|
s.summary = %q{DataMapper plugin allowing the creation of nested sets from data models}
|
41
41
|
s.test_files = [
|
42
42
|
"spec/integration/nested_set_spec.rb",
|
@@ -47,18 +47,18 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.specification_version = 3
|
48
48
|
|
49
49
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
-
s.add_runtime_dependency(%q<dm-adjust>, ["~> 1.1.0.
|
50
|
+
s.add_runtime_dependency(%q<dm-adjust>, ["~> 1.1.0.rc3"])
|
51
51
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
52
52
|
s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
|
53
53
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
54
54
|
else
|
55
|
-
s.add_dependency(%q<dm-adjust>, ["~> 1.1.0.
|
55
|
+
s.add_dependency(%q<dm-adjust>, ["~> 1.1.0.rc3"])
|
56
56
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
57
57
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
58
58
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
59
59
|
end
|
60
60
|
else
|
61
|
-
s.add_dependency(%q<dm-adjust>, ["~> 1.1.0.
|
61
|
+
s.add_dependency(%q<dm-adjust>, ["~> 1.1.0.rc3"])
|
62
62
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
63
63
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
64
64
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
@@ -70,7 +70,8 @@ module DataMapper
|
|
70
70
|
def root
|
71
71
|
# TODO scoping
|
72
72
|
# what should this return if there is a scope? always false, or node if there is only one?
|
73
|
-
|
73
|
+
args = DataMapper::Ext::Array.to_hash(nested_set_parent.zip([]))
|
74
|
+
roots.length > 1 ? false : first(args)
|
74
75
|
end
|
75
76
|
|
76
77
|
##
|
@@ -79,7 +80,8 @@ module DataMapper
|
|
79
80
|
def roots
|
80
81
|
# TODO scoping
|
81
82
|
# TODO supply filtering-option?
|
82
|
-
|
83
|
+
args = DataMapper::Ext::Array.to_hash(nested_set_parent.zip([]))
|
84
|
+
all(args)
|
83
85
|
end
|
84
86
|
|
85
87
|
##
|
@@ -115,7 +117,8 @@ module DataMapper
|
|
115
117
|
#
|
116
118
|
# @private
|
117
119
|
def nested_set_scope
|
118
|
-
model.base_model.nested_set_scope.map{ |p| [ p, attribute_get(p) ] }
|
120
|
+
pairs = model.base_model.nested_set_scope.map{ |p| [ p, attribute_get(p) ] }
|
121
|
+
DataMapper::Ext::Array.to_hash(pairs)
|
119
122
|
end
|
120
123
|
|
121
124
|
##
|
@@ -123,7 +126,10 @@ module DataMapper
|
|
123
126
|
# @private
|
124
127
|
def original_nested_set_scope
|
125
128
|
# TODO commit
|
126
|
-
model.base_model.nested_set_scope.map{ |p|
|
129
|
+
pairs = model.base_model.nested_set_scope.map{ |p|
|
130
|
+
[ p, (property = properties[p]) && original_attributes.key?(property) ? original_attributes[property] : attribute_get(p) ]
|
131
|
+
}
|
132
|
+
DataMapper::Ext::Array.to_hash(pairs)
|
127
133
|
end
|
128
134
|
|
129
135
|
##
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dm-is-nested_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 1.1.0.
|
5
|
+
version: 1.1.0.rc3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sindre Aarsaether
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-10 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.1.0.
|
23
|
+
version: 1.1.0.rc3
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: *id001
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements: []
|
107
107
|
|
108
108
|
rubyforge_project: datamapper
|
109
|
-
rubygems_version: 1.
|
109
|
+
rubygems_version: 1.6.2
|
110
110
|
signing_key:
|
111
111
|
specification_version: 3
|
112
112
|
summary: DataMapper plugin allowing the creation of nested sets from data models
|