couchbase-model-relationship 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,8 +72,9 @@ module Couchbase
72
72
 
73
73
  module ClassMethods
74
74
  def inherited(base)
75
+ children = child_associations
75
76
  base.class_eval do
76
- @_children = child_associations
77
+ @_children = children
77
78
  end
78
79
  end
79
80
 
@@ -1,7 +1,7 @@
1
1
  module Couchbase
2
2
  class Model
3
3
  module Relationship
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
6
6
  end
7
7
  end
data/spec/parent_spec.rb CHANGED
@@ -57,8 +57,16 @@ describe "parent" do
57
57
  subject.should respond_to(:child)
58
58
  end
59
59
 
60
- it "passes on it's children" do
61
- InheritanceTest.child_association_names.should eq(ParentTest.child_association_names)
60
+ context "being inherited" do
61
+ it "passes on it's children" do
62
+ InheritanceTest.child_association_names.should eq(ParentTest.child_association_names)
63
+ end
64
+
65
+ it "has the children work properly" do
66
+ Child.stubs(_find: nil)
67
+
68
+ InheritanceTest.new.child.should be_a(Child)
69
+ end
62
70
  end
63
71
 
64
72
  context "the getter" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase-model-relationship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -218,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  segments:
220
220
  - 0
221
- hash: 1987298715392037877
221
+ hash: -4399593191261304295
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  none: false
224
224
  requirements:
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  segments:
229
229
  - 0
230
- hash: 1987298715392037877
230
+ hash: -4399593191261304295
231
231
  requirements: []
232
232
  rubyforge_project:
233
233
  rubygems_version: 1.8.24