vidibus-inheritance 0.3.13 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -94,7 +94,8 @@ To control how inherited data will be updated, you may define a callback method
94
94
 
95
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
96
  * Use delayed_job for inheritance across a huge pedigree.
97
- * Maybe use UUID for children to ensure portability across the network?
97
+ * Fix relations when deleting an ancestor.
98
+ * Rewrite root_ancestor_id when deleting the root ancestor.
98
99
 
99
100
 
100
101
  == Copyright
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.13
1
+ 0.3.14
@@ -1,3 +1,2 @@
1
1
  require "inheritance/mongoid"
2
2
  require "inheritance/validators"
3
-
@@ -124,11 +124,12 @@ module Vidibus
124
124
  self.save!
125
125
  end
126
126
 
127
- # Performs inheritance from given object.
127
+ # Performs inheritance from given object and returns self.
128
128
  # It sets the ancestor and then calls #inherit! with given options.
129
129
  def inherit_from!(obj, options = {})
130
130
  self.ancestor = obj
131
131
  self.inherit!(options)
132
+ self
132
133
  end
133
134
 
134
135
  # Returns inheritors of this ancestor.
@@ -205,6 +205,10 @@ describe "Vidibus::Inheritance::Mongoid" do
205
205
  mock(inheritor).inherit!
206
206
  inheritor.inherit!
207
207
  end
208
+
209
+ it "should return the inheritor" do
210
+ Model.new.inherit_from!(ancestor).should be_a(Model)
211
+ end
208
212
  end
209
213
 
210
214
  describe "#inheritors" do
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vidibus-inheritance}
8
- s.version = "0.3.13"
8
+ s.version = "0.3.14"
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-09-03}
12
+ s.date = %q{2010-09-09}
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 = [
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: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 13
10
- version: 0.3.13
9
+ - 14
10
+ version: 0.3.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andre Pankratz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-03 00:00:00 +02:00
18
+ date: 2010-09-09 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency