vidibus-inheritance 0.3.11 → 0.3.12
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.
- data/.bundle/config +2 -0
- data/.rspec +2 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +69 -0
- data/README.rdoc +7 -0
- data/Rakefile +7 -18
- data/VERSION +1 -1
- data/lib/vidibus/inheritance/mongoid.rb +30 -6
- data/spec/spec_helper.rb +10 -6
- data/spec/vidibus/inheritance/inheritance_spec.rb +2 -4
- data/spec/vidibus/inheritance/mongoid_spec.rb +28 -8
- data/vidibus-inheritance.gemspec +11 -19
- metadata +19 -62
- data/TODO +0 -4
- data/spec/spec.opts +0 -2
data/.bundle/config
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
gem "mongoid", "~> 2.0.0.beta.17"
|
4
|
+
gem "bson_ext", "~> 1.0.7"
|
5
|
+
gem "vidibus-core_extensions"
|
6
|
+
gem "vidibus-uuid"
|
7
|
+
|
8
|
+
# Development dependecies
|
9
|
+
gem "gemcutter", "0.5.0"
|
10
|
+
gem "jeweler"
|
11
|
+
gem "rake"
|
12
|
+
gem "rspec", "~> 2.0.0.beta.20"
|
13
|
+
gem "rspec-rails", "~> 2.0.0.beta.20"
|
14
|
+
gem "rr"
|
15
|
+
gem "relevance-rcov"
|
16
|
+
gem "activesupport", "~> 3.0.0"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.0.0)
|
5
|
+
activesupport (= 3.0.0)
|
6
|
+
builder (~> 2.1.2)
|
7
|
+
i18n (~> 0.4.1)
|
8
|
+
activesupport (3.0.0)
|
9
|
+
bson (1.0.4)
|
10
|
+
bson_ext (1.0.7)
|
11
|
+
builder (2.1.2)
|
12
|
+
diff-lcs (1.1.2)
|
13
|
+
gemcutter (0.5.0)
|
14
|
+
json_pure
|
15
|
+
git (1.2.5)
|
16
|
+
i18n (0.4.1)
|
17
|
+
jeweler (1.4.0)
|
18
|
+
gemcutter (>= 0.1.0)
|
19
|
+
git (>= 1.2.5)
|
20
|
+
rubyforge (>= 2.0.0)
|
21
|
+
json_pure (1.4.6)
|
22
|
+
macaddr (1.0.0)
|
23
|
+
mongo (1.0.7)
|
24
|
+
bson (>= 1.0.4)
|
25
|
+
mongoid (2.0.0.beta.17)
|
26
|
+
activemodel (~> 3.0.0)
|
27
|
+
bson (= 1.0.4)
|
28
|
+
mongo (= 1.0.7)
|
29
|
+
tzinfo (~> 0.3.22)
|
30
|
+
will_paginate (~> 3.0.pre)
|
31
|
+
rake (0.8.7)
|
32
|
+
relevance-rcov (0.9.2.1)
|
33
|
+
rr (1.0.0)
|
34
|
+
rspec (2.0.0.beta.20)
|
35
|
+
rspec-core (= 2.0.0.beta.20)
|
36
|
+
rspec-expectations (= 2.0.0.beta.20)
|
37
|
+
rspec-mocks (= 2.0.0.beta.20)
|
38
|
+
rspec-core (2.0.0.beta.20)
|
39
|
+
rspec-expectations (2.0.0.beta.20)
|
40
|
+
diff-lcs (>= 1.1.2)
|
41
|
+
rspec-mocks (2.0.0.beta.20)
|
42
|
+
rspec-rails (2.0.0.beta.20)
|
43
|
+
rspec (= 2.0.0.beta.20)
|
44
|
+
rubyforge (2.0.4)
|
45
|
+
json_pure (>= 1.1.7)
|
46
|
+
tzinfo (0.3.23)
|
47
|
+
uuid (2.3.1)
|
48
|
+
macaddr (~> 1.0)
|
49
|
+
vidibus-core_extensions (0.3.5)
|
50
|
+
vidibus-uuid (0.3.6)
|
51
|
+
uuid
|
52
|
+
will_paginate (3.0.pre2)
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
ruby
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
activesupport (~> 3.0.0)
|
59
|
+
bson_ext (~> 1.0.7)
|
60
|
+
gemcutter (= 0.5.0)
|
61
|
+
jeweler
|
62
|
+
mongoid (~> 2.0.0.beta.17)
|
63
|
+
rake
|
64
|
+
relevance-rcov
|
65
|
+
rr
|
66
|
+
rspec (~> 2.0.0.beta.20)
|
67
|
+
rspec-rails (~> 2.0.0.beta.20)
|
68
|
+
vidibus-core_extensions
|
69
|
+
vidibus-uuid
|
data/README.rdoc
CHANGED
@@ -90,6 +90,13 @@ To control how inherited data will be updated, you may define a callback method
|
|
90
90
|
end
|
91
91
|
|
92
92
|
|
93
|
+
== TODO
|
94
|
+
|
95
|
+
* Removed items will be re-added when inheritance is performed again. Introduce paranoid behaviour for embedded collection items? Or add a list of deleted associations like _destroyed_children?
|
96
|
+
* Use delayed_job for inheritance across a huge pedigree.
|
97
|
+
* Maybe use UUID for children to ensure portability across the network?
|
98
|
+
|
99
|
+
|
93
100
|
== Copyright
|
94
101
|
|
95
102
|
Copyright (c) 2010 Andre Pankratz. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "rake"
|
3
|
+
require "rake/rdoctask"
|
4
|
+
require "rspec"
|
5
|
+
require "rspec/core/rake_task"
|
3
6
|
|
4
7
|
begin
|
5
8
|
require "jeweler"
|
@@ -10,39 +13,25 @@ begin
|
|
10
13
|
gem.email = "andre@vidibus.com"
|
11
14
|
gem.homepage = "http://github.com/vidibus/vidibus-inheritance"
|
12
15
|
gem.authors = ["Andre Pankratz"]
|
13
|
-
gem.
|
14
|
-
gem.add_development_dependency "relevance-rcov"
|
15
|
-
gem.add_development_dependency "rr"
|
16
|
-
gem.add_development_dependency "mongoid", "= 2.0.0.beta.15"
|
16
|
+
gem.add_dependency "mongoid", "~> 2.0.0.beta.17"
|
17
17
|
gem.add_dependency "vidibus-core_extensions"
|
18
18
|
gem.add_dependency "vidibus-uuid"
|
19
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
20
19
|
end
|
21
20
|
Jeweler::GemcutterTasks.new
|
22
21
|
rescue LoadError
|
23
22
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
24
23
|
end
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
spec.libs << "lib" << "spec"
|
29
|
-
spec.spec_files = FileList["spec/**/*_spec.rb"]
|
30
|
-
end
|
31
|
-
|
32
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
33
|
-
t.spec_files = FileList["spec/vidibus/**/*_spec.rb"]
|
25
|
+
Rspec::Core::RakeTask.new(:rcov) do |t|
|
26
|
+
t.pattern = "spec/**/*_spec.rb"
|
34
27
|
t.rcov = true
|
35
28
|
t.rcov_opts = ["--exclude", "^spec,/gems/"]
|
36
29
|
end
|
37
30
|
|
38
|
-
task :spec => :check_dependencies
|
39
|
-
task :default => :spec
|
40
|
-
|
41
|
-
require "rake/rdoctask"
|
42
31
|
Rake::RDocTask.new do |rdoc|
|
43
32
|
version = File.exist?("VERSION") ? File.read("VERSION") : ""
|
44
33
|
rdoc.rdoc_dir = "rdoc"
|
45
|
-
rdoc.title = "vidibus-
|
34
|
+
rdoc.title = "vidibus-inheritance #{version}"
|
46
35
|
rdoc.rdoc_files.include("README*")
|
47
36
|
rdoc.rdoc_files.include("lib/**/*.rb")
|
48
37
|
rdoc.options << "--charset=utf-8"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
@@ -3,7 +3,7 @@ module Vidibus
|
|
3
3
|
module Mongoid
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
ACQUIRED_ATTRIBUTES = %w[_id _type uuid ancestor_uuid mutated_attributes mutated created_at updated_at version versions]
|
6
|
+
ACQUIRED_ATTRIBUTES = %w[_id _type uuid ancestor_uuid root_ancestor_uuid mutated_attributes mutated created_at updated_at version versions]
|
7
7
|
|
8
8
|
included do
|
9
9
|
|
@@ -14,14 +14,17 @@ module Vidibus
|
|
14
14
|
attr_protected :mutated_attributes, :mutated
|
15
15
|
|
16
16
|
field :ancestor_uuid
|
17
|
+
field :root_ancestor_uuid
|
17
18
|
field :mutated_attributes, :type => Array, :default => []
|
18
19
|
field :mutated, :type => Boolean
|
19
|
-
|
20
|
+
|
20
21
|
validates :ancestor_uuid, :uuid => { :allow_blank => true }
|
22
|
+
validates :root_ancestor_uuid, :uuid => { :allow_blank => true }
|
21
23
|
validates :ancestor, :ancestor => true, :if => :ancestor_uuid?
|
24
|
+
validates :root_ancestor, :ancestor => true, :if => :root_ancestor_uuid?
|
22
25
|
|
23
26
|
set_callback :validate, :before, :inherit_attributes, :if => :inherit?
|
24
|
-
set_callback :save, :before, :track_mutations
|
27
|
+
set_callback :save, :before, :track_mutations, :set_root_ancestor
|
25
28
|
set_callback :save, :after, :postprocess
|
26
29
|
set_callback :destroy, :after, :destroy_inheritors
|
27
30
|
|
@@ -67,9 +70,9 @@ module Vidibus
|
|
67
70
|
#
|
68
71
|
# Examples:
|
69
72
|
#
|
70
|
-
# Model.
|
71
|
-
# Model.
|
72
|
-
# Model.
|
73
|
+
# Model.roots # => All models without ancestor
|
74
|
+
# Model.roots.where(:name => "Laura") # => Only models named Laura
|
75
|
+
# Model.roots.asc(:created_at) # => All models, ordered by date of creation
|
73
76
|
#
|
74
77
|
def roots
|
75
78
|
where(:ancestor_uuid => nil)
|
@@ -100,6 +103,13 @@ module Vidibus
|
|
100
103
|
end
|
101
104
|
end
|
102
105
|
|
106
|
+
# Returns root ancestor object by uuid.
|
107
|
+
def root_ancestor
|
108
|
+
@root_ancestor ||= begin
|
109
|
+
self.class.where(:uuid => root_ancestor_uuid).first if root_ancestor_uuid
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
103
113
|
# Performs inheritance and saves instance with force.
|
104
114
|
# Accepts :reset option to overwrite mutated attributes.
|
105
115
|
#
|
@@ -300,6 +310,20 @@ module Vidibus
|
|
300
310
|
return unless inheritors.any?
|
301
311
|
inheritors.each(&:destroy)
|
302
312
|
end
|
313
|
+
|
314
|
+
# Sets root ancestor from ancestor:
|
315
|
+
# If ancestor is the root ancestor, he will be set.
|
316
|
+
# If ancestor has an ancestor himself, his root ancestor will be set.
|
317
|
+
def set_root_ancestor
|
318
|
+
@root_ancestor = nil # reset cache
|
319
|
+
if !ancestor_uuid
|
320
|
+
self.root_ancestor_uuid = nil
|
321
|
+
elsif ancestor and !ancestor.ancestor_uuid
|
322
|
+
self.root_ancestor_uuid = ancestor_uuid
|
323
|
+
else
|
324
|
+
self.root_ancestor_uuid = ancestor.root_ancestor_uuid
|
325
|
+
end
|
326
|
+
end
|
303
327
|
end
|
304
328
|
end
|
305
329
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,9 +3,10 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
|
3
3
|
|
4
4
|
require "rubygems"
|
5
5
|
require "active_support/core_ext"
|
6
|
-
require "
|
6
|
+
require "rspec"
|
7
7
|
require "rr"
|
8
8
|
require "mongoid"
|
9
|
+
|
9
10
|
require "vidibus-uuid"
|
10
11
|
require "vidibus-inheritance"
|
11
12
|
require "models"
|
@@ -14,18 +15,21 @@ Mongoid.configure do |config|
|
|
14
15
|
name = "vidibus-inheritance_test"
|
15
16
|
host = "localhost"
|
16
17
|
config.master = Mongo::Connection.new.db(name)
|
18
|
+
config.logger = nil
|
17
19
|
end
|
18
20
|
|
19
|
-
|
20
|
-
config.mock_with
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.mock_with :rr
|
21
23
|
config.before(:each) do
|
22
|
-
Mongoid.master.collections.select { |c| c.name
|
24
|
+
Mongoid.master.collections.select { |c| c.name !~ /system/ }.each(&:drop)
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
28
|
# Helper for stubbing time. Define String to be set as Time.now.
|
27
|
-
#
|
28
|
-
#
|
29
|
+
# Usage:
|
30
|
+
# stub_time!('01.01.2010 14:00')
|
31
|
+
# stub_time!(2.days.ago)
|
32
|
+
#
|
29
33
|
def stub_time!(string = nil)
|
30
34
|
now = string ? Time.parse(string.to_s) : Time.now
|
31
35
|
stub(Time).now { now }
|
@@ -15,9 +15,8 @@ describe "Inheritance" do
|
|
15
15
|
it "should happen when ancestor did change" do
|
16
16
|
inheritor = Model.create!
|
17
17
|
inheritor.ancestor = ancestor
|
18
|
-
|
18
|
+
mock(inheritor).inherit_attributes
|
19
19
|
inheritor.save
|
20
|
-
inheritor.should have_received.inherit_attributes
|
21
20
|
end
|
22
21
|
|
23
22
|
it "should not happen when ancestor did not change" do
|
@@ -441,5 +440,4 @@ describe "Inheritance" do
|
|
441
440
|
end
|
442
441
|
end
|
443
442
|
end
|
444
|
-
|
445
|
-
end
|
443
|
+
end
|
@@ -126,20 +126,43 @@ describe "Vidibus::Inheritance::Mongoid" do
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
+
describe "#root_ancestor" do
|
130
|
+
it "should be nil if no ancestor is given" do
|
131
|
+
anna.ancestor.should be_nil
|
132
|
+
anna.root_ancestor.should be_nil
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should return ancestor if ancestor is the root one" do
|
136
|
+
jeanny.inherit_from!(anna)
|
137
|
+
jeanny.root_ancestor.should eql(anna)
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should be inherited from ancestor" do
|
141
|
+
anna.inherit_from!(ancestor)
|
142
|
+
jeanny.inherit_from!(anna)
|
143
|
+
jeanny.root_ancestor.should eql(ancestor)
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should be changeable" do
|
147
|
+
jeanny.inherit_from!(anna)
|
148
|
+
jeanny.root_ancestor.should eql(anna)
|
149
|
+
jeanny.inherit_from!(ancestor)
|
150
|
+
jeanny.root_ancestor.should eql(ancestor)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
129
154
|
describe "#inherit!" do
|
130
155
|
it "should call #inherit_attributes once" do
|
131
156
|
stub(inheritor)._inherited { true }
|
132
|
-
|
157
|
+
mock(inheritor).inherit_attributes({})
|
133
158
|
inheritor.ancestor = anna
|
134
159
|
inheritor.inherit!
|
135
|
-
inheritor.should have_received.inherit_attributes.once.with_any_args
|
136
160
|
end
|
137
161
|
|
138
162
|
it "should call #save!" do
|
139
|
-
|
163
|
+
mock(inheritor).save!
|
140
164
|
inheritor.ancestor = anna
|
141
165
|
inheritor.inherit!
|
142
|
-
inheritor.should have_received.save!
|
143
166
|
end
|
144
167
|
|
145
168
|
context "with mutations" do
|
@@ -172,8 +195,6 @@ describe "Vidibus::Inheritance::Mongoid" do
|
|
172
195
|
end
|
173
196
|
|
174
197
|
describe "#inherit_from!" do
|
175
|
-
#let(:ancestor) { Model.create!(:name => "Anna", :age => 35) }
|
176
|
-
|
177
198
|
it "should set ancestor" do
|
178
199
|
inheritor.ancestor.should be_nil
|
179
200
|
inheritor.inherit_from!(ancestor)
|
@@ -181,9 +202,8 @@ describe "Vidibus::Inheritance::Mongoid" do
|
|
181
202
|
end
|
182
203
|
|
183
204
|
it "should call #inherit!" do
|
184
|
-
|
205
|
+
mock(inheritor).inherit!
|
185
206
|
inheritor.inherit!
|
186
|
-
inheritor.should have_received(:inherit!)
|
187
207
|
end
|
188
208
|
end
|
189
209
|
|
data/vidibus-inheritance.gemspec
CHANGED
@@ -5,25 +5,27 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vidibus-inheritance}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andre Pankratz"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-02}
|
13
13
|
s.description = %q{This gem allows inheritance of objects for Rails 3 with Mongoid. It will update all attributes and embedded documents of inheritors when ancestor gets changed.}
|
14
14
|
s.email = %q{andre@vidibus.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
"TODO"
|
17
|
+
"README.rdoc"
|
19
18
|
]
|
20
19
|
s.files = [
|
21
|
-
".
|
20
|
+
".bundle/config",
|
21
|
+
".document",
|
22
22
|
".gitignore",
|
23
|
+
".rspec",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
23
26
|
"LICENSE",
|
24
27
|
"README.rdoc",
|
25
28
|
"Rakefile",
|
26
|
-
"TODO",
|
27
29
|
"VERSION",
|
28
30
|
"lib/vidibus-inheritance.rb",
|
29
31
|
"lib/vidibus/inheritance.rb",
|
@@ -31,7 +33,6 @@ Gem::Specification.new do |s|
|
|
31
33
|
"lib/vidibus/inheritance/validators.rb",
|
32
34
|
"lib/vidibus/inheritance/validators/ancestor_validator.rb",
|
33
35
|
"spec/models.rb",
|
34
|
-
"spec/spec.opts",
|
35
36
|
"spec/spec_helper.rb",
|
36
37
|
"spec/vidibus/inheritance/cloning_spec.rb",
|
37
38
|
"spec/vidibus/inheritance/inheritance_spec.rb",
|
@@ -58,25 +59,16 @@ Gem::Specification.new do |s|
|
|
58
59
|
s.specification_version = 3
|
59
60
|
|
60
61
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.
|
62
|
-
s.add_development_dependency(%q<relevance-rcov>, [">= 0"])
|
63
|
-
s.add_development_dependency(%q<rr>, [">= 0"])
|
64
|
-
s.add_development_dependency(%q<mongoid>, ["= 2.0.0.beta.15"])
|
62
|
+
s.add_runtime_dependency(%q<mongoid>, ["~> 2.0.0.beta.17"])
|
65
63
|
s.add_runtime_dependency(%q<vidibus-core_extensions>, [">= 0"])
|
66
64
|
s.add_runtime_dependency(%q<vidibus-uuid>, [">= 0"])
|
67
65
|
else
|
68
|
-
s.add_dependency(%q<
|
69
|
-
s.add_dependency(%q<relevance-rcov>, [">= 0"])
|
70
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
71
|
-
s.add_dependency(%q<mongoid>, ["= 2.0.0.beta.15"])
|
66
|
+
s.add_dependency(%q<mongoid>, ["~> 2.0.0.beta.17"])
|
72
67
|
s.add_dependency(%q<vidibus-core_extensions>, [">= 0"])
|
73
68
|
s.add_dependency(%q<vidibus-uuid>, [">= 0"])
|
74
69
|
end
|
75
70
|
else
|
76
|
-
s.add_dependency(%q<
|
77
|
-
s.add_dependency(%q<relevance-rcov>, [">= 0"])
|
78
|
-
s.add_dependency(%q<rr>, [">= 0"])
|
79
|
-
s.add_dependency(%q<mongoid>, ["= 2.0.0.beta.15"])
|
71
|
+
s.add_dependency(%q<mongoid>, ["~> 2.0.0.beta.17"])
|
80
72
|
s.add_dependency(%q<vidibus-core_extensions>, [">= 0"])
|
81
73
|
s.add_dependency(%q<vidibus-uuid>, [">= 0"])
|
82
74
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-inheritance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 12
|
10
|
+
version: 0.3.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Pankratz
|
@@ -15,75 +15,31 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
name: rspec
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 13
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 2
|
33
|
-
- 9
|
34
|
-
version: 1.2.9
|
35
|
-
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: relevance-rcov
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 3
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
version: "0"
|
49
|
-
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: rr
|
53
|
-
prerelease: false
|
54
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 3
|
60
|
-
segments:
|
61
|
-
- 0
|
62
|
-
version: "0"
|
63
|
-
type: :development
|
64
|
-
version_requirements: *id003
|
65
21
|
- !ruby/object:Gem::Dependency
|
66
22
|
name: mongoid
|
67
23
|
prerelease: false
|
68
|
-
requirement: &
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
69
25
|
none: false
|
70
26
|
requirements:
|
71
|
-
- -
|
27
|
+
- - ~>
|
72
28
|
- !ruby/object:Gem::Version
|
73
|
-
hash:
|
29
|
+
hash: 62196417
|
74
30
|
segments:
|
75
31
|
- 2
|
76
32
|
- 0
|
77
33
|
- 0
|
78
34
|
- beta
|
79
|
-
-
|
80
|
-
version: 2.0.0.beta.
|
81
|
-
type: :
|
82
|
-
version_requirements: *
|
35
|
+
- 17
|
36
|
+
version: 2.0.0.beta.17
|
37
|
+
type: :runtime
|
38
|
+
version_requirements: *id001
|
83
39
|
- !ruby/object:Gem::Dependency
|
84
40
|
name: vidibus-core_extensions
|
85
41
|
prerelease: false
|
86
|
-
requirement: &
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
87
43
|
none: false
|
88
44
|
requirements:
|
89
45
|
- - ">="
|
@@ -93,11 +49,11 @@ dependencies:
|
|
93
49
|
- 0
|
94
50
|
version: "0"
|
95
51
|
type: :runtime
|
96
|
-
version_requirements: *
|
52
|
+
version_requirements: *id002
|
97
53
|
- !ruby/object:Gem::Dependency
|
98
54
|
name: vidibus-uuid
|
99
55
|
prerelease: false
|
100
|
-
requirement: &
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
101
57
|
none: false
|
102
58
|
requirements:
|
103
59
|
- - ">="
|
@@ -107,7 +63,7 @@ dependencies:
|
|
107
63
|
- 0
|
108
64
|
version: "0"
|
109
65
|
type: :runtime
|
110
|
-
version_requirements: *
|
66
|
+
version_requirements: *id003
|
111
67
|
description: This gem allows inheritance of objects for Rails 3 with Mongoid. It will update all attributes and embedded documents of inheritors when ancestor gets changed.
|
112
68
|
email: andre@vidibus.com
|
113
69
|
executables: []
|
@@ -117,14 +73,16 @@ extensions: []
|
|
117
73
|
extra_rdoc_files:
|
118
74
|
- LICENSE
|
119
75
|
- README.rdoc
|
120
|
-
- TODO
|
121
76
|
files:
|
77
|
+
- .bundle/config
|
122
78
|
- .document
|
123
79
|
- .gitignore
|
80
|
+
- .rspec
|
81
|
+
- Gemfile
|
82
|
+
- Gemfile.lock
|
124
83
|
- LICENSE
|
125
84
|
- README.rdoc
|
126
85
|
- Rakefile
|
127
|
-
- TODO
|
128
86
|
- VERSION
|
129
87
|
- lib/vidibus-inheritance.rb
|
130
88
|
- lib/vidibus/inheritance.rb
|
@@ -132,7 +90,6 @@ files:
|
|
132
90
|
- lib/vidibus/inheritance/validators.rb
|
133
91
|
- lib/vidibus/inheritance/validators/ancestor_validator.rb
|
134
92
|
- spec/models.rb
|
135
|
-
- spec/spec.opts
|
136
93
|
- spec/spec_helper.rb
|
137
94
|
- spec/vidibus/inheritance/cloning_spec.rb
|
138
95
|
- spec/vidibus/inheritance/inheritance_spec.rb
|
data/TODO
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
* Removed items will be re-added when inheritance is performed again. Introduce paranoid behaviour for embedded collection items? Or add a list of deleted associations like _destroyed_children?
|
2
|
-
* Use delayed_job for inheritance across a huge pedigree.
|
3
|
-
* Maybe use UUID for children to ensure portability across the network?
|
4
|
-
* Get ACQUIRED_ATTRIBUTES as class variable from each document, if available.
|
data/spec/spec.opts
DELETED