mongoid 0.6.8 → 0.6.9
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/VERSION +1 -1
- data/lib/mongoid/associations/decorator.rb +1 -3
- data/mongoid.gemspec +1 -1
- data/spec/unit/mongoid/associations/accessor_spec.rb +3 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.9
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Mongoid #:nodoc:
|
2
2
|
module Associations #:nodoc:
|
3
3
|
module Decorator #:nodoc:
|
4
|
-
EXTRAS = [:save, :save!, :==]
|
5
|
-
|
6
4
|
def self.included(base)
|
7
5
|
base.class_eval do
|
8
6
|
attr_reader :document
|
@@ -12,7 +10,7 @@ module Mongoid #:nodoc:
|
|
12
10
|
# since we can ask the class for its methods and get an
|
13
11
|
# accurate list.
|
14
12
|
def decorate!
|
15
|
-
meths = document.public_methods
|
13
|
+
meths = document.public_methods
|
16
14
|
meths.each do |method|
|
17
15
|
(class << self; self; end).class_eval do
|
18
16
|
define_method method do |*args|
|
data/mongoid.gemspec
CHANGED
@@ -24,7 +24,7 @@ describe Mongoid::Associations::Accessor do
|
|
24
24
|
|
25
25
|
it "returns a HasOne" do
|
26
26
|
association = Mongoid::Associations::Accessor.get(Mongoid::Associations::HasOne, :name, @document)
|
27
|
-
association.should be_a_kind_of(
|
27
|
+
association.should be_a_kind_of(Name)
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -43,8 +43,8 @@ describe Mongoid::Associations::Accessor do
|
|
43
43
|
context "when type is belongs_to" do
|
44
44
|
|
45
45
|
it "returns a BelongsTo" do
|
46
|
-
association = Mongoid::Associations::Accessor.get(Mongoid::Associations::BelongsTo, :person, @document)
|
47
|
-
association.should be_a_kind_of(
|
46
|
+
association = Mongoid::Associations::Accessor.get(Mongoid::Associations::BelongsTo, :person, stub(:parent => @document))
|
47
|
+
association.should be_a_kind_of(Person)
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|