mongoid 0.11.1 → 0.11.2

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/HISTORY CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.11.2
2
+ - Fixing bug where has many and has one relational
3
+ associations create method did not return the
4
+ associated document
5
+
1
6
  === 0.11.1
2
7
  - Querying for classes that have subclasses will also
3
8
  return the subclasses as well, similar to
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.1
1
+ 0.11.2
@@ -41,6 +41,7 @@ module Mongoid #:nodoc:
41
41
  def create(attributes)
42
42
  object = build(attributes)
43
43
  object.save
44
+ object
44
45
  end
45
46
 
46
47
  # Finds a document in this association.
@@ -13,6 +13,7 @@ module Mongoid #:nodoc:
13
13
  @document = @klass.instantiate(attributes)
14
14
  name = @parent.class.to_s.underscore
15
15
  @document.send("#{name}=", @parent)
16
+ @document
16
17
  end
17
18
 
18
19
  # Builds a new Document and sets it as the association, then saves the
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid}
8
- s.version = "0.11.1"
8
+ s.version = "0.11.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Durran Jordan"]
@@ -165,6 +165,10 @@ describe Mongoid::Associations::HasManyRelated do
165
165
  @association.create(:title => "Sassy")
166
166
  end
167
167
 
168
+ it "returns the new object" do
169
+ @association.create(:title => "Sassy").should be_a_kind_of(Post)
170
+ end
171
+
168
172
  end
169
173
 
170
174
  describe "#find" do
@@ -49,6 +49,10 @@ describe Mongoid::Associations::HasOneRelated do
49
49
  @association.person_id.should == @parent.id
50
50
  end
51
51
 
52
+ it "returns the new document" do
53
+ @association.create(:score => 100).should be_a_kind_of(Game)
54
+ end
55
+
52
56
  end
53
57
 
54
58
  describe ".initialize" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan