mongo_mapper 0.15.2 → 0.15.3
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.
- checksums.yaml +4 -4
- data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +1 -1
- data/lib/mongo_mapper/version.rb +1 -1
- data/spec/examples.txt +1695 -1694
- data/spec/functional/associations/belongs_to_proxy_spec.rb +15 -0
- data/spec/spec_helper.rb +7 -0
- metadata +2 -2
@@ -286,5 +286,20 @@ describe "BelongsToProxy" do
|
|
286
286
|
|
287
287
|
comment.post.should == nil
|
288
288
|
end
|
289
|
+
|
290
|
+
it "should reset parent when foreign key is changed from nil" do
|
291
|
+
post = @post_class.create!
|
292
|
+
comment = @comment_class.create!(post: nil)
|
293
|
+
|
294
|
+
comment.post.should == nil
|
295
|
+
|
296
|
+
comment.post_id = post.id
|
297
|
+
|
298
|
+
comment.post.should == post
|
299
|
+
|
300
|
+
comment.post_id = nil
|
301
|
+
|
302
|
+
comment.post.should == nil
|
303
|
+
end
|
289
304
|
end
|
290
305
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,13 @@ $:.unshift(File.expand_path('../../lib', __FILE__))
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'bundler/setup'
|
5
|
+
|
6
|
+
# workaround for https://github.com/jruby/jruby/issues/6547
|
7
|
+
if RUBY_PLATFORM == 'java'
|
8
|
+
require 'i18n/backend'
|
9
|
+
require 'i18n/backend/simple'
|
10
|
+
end
|
11
|
+
|
5
12
|
Bundler.require(:default)
|
6
13
|
require 'fileutils'
|
7
14
|
require 'timecop'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-02-
|
13
|
+
date: 2021-02-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mongo
|