mm_partial_update 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,14 @@ module MongoMapper
9
9
  module Plugins
10
10
  module Associations
11
11
 
12
+ class Proxy
13
+ def add_updates_to_command(*args)
14
+ #noop - this needs to be here to prevent this call from
15
+ # bubbling up to the document. For non-embedded proxies, there
16
+ # no updates to add to the command.
17
+ end
18
+ end
19
+
12
20
  class EmbeddedCollection
13
21
  def persistable?
14
22
  kind_of?(MmPartialUpdate::EmbeddedCollection)
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module MmPartialUpdate
3
- Version = '0.1.1'
3
+ Version = '0.1.2'
4
4
  end
@@ -157,7 +157,18 @@ class TestPartialUpdate < Test::Unit::TestCase
157
157
  pet.history.should == [:before_validation, :after_validation,
158
158
  :before_save, :before_update, :after_update, :after_save]
159
159
  end
160
+ end
161
+
162
+ context "Non-embedded associations" do
163
+ should 'be business as usual' do
164
+ p = Person.new :name=>"Willard"
165
+ p.happy_place = HappyPlace.new :description=>"A cool breeze rustles my hair as terradactyls glide gracefully overhead"
166
+ p.save!
160
167
 
168
+ p.reload
169
+ p.happy_place.should_not be_nil
170
+ end
161
171
  end
162
172
 
173
+
163
174
  end
data/test/models.rb CHANGED
@@ -6,9 +6,15 @@ class Person
6
6
 
7
7
  key :name, String
8
8
  many :pets
9
+ one :happy_place
9
10
  one :favorite_pet, :class_name=>'Pet'
11
+ end
10
12
 
11
-
13
+ class HappyPlace #Test non-embedded proxies
14
+ include MongoMapper::Document
15
+ key :description, String
16
+ key :person_id, ObjectId
17
+ belongs_to :person
12
18
  end
13
19
 
14
20
  class ValidatedPerson < Person
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm_partial_update
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Stults
@@ -15,11 +15,14 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-31 00:00:00 -07:00
18
+ date: 2010-11-23 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ type: :runtime
23
+ name: observables
24
+ prerelease: false
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
26
  none: false
24
27
  requirements:
25
28
  - - ~>
@@ -30,12 +33,12 @@ dependencies:
30
33
  - 1
31
34
  - 2
32
35
  version: 0.1.2
36
+ requirement: *id001
37
+ - !ruby/object:Gem::Dependency
33
38
  type: :runtime
34
- name: observables
39
+ name: mm_dirtier
35
40
  prerelease: false
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
42
  none: false
40
43
  requirements:
41
44
  - - ~>
@@ -46,12 +49,12 @@ dependencies:
46
49
  - 1
47
50
  - 1
48
51
  version: 0.1.1
49
- type: :runtime
50
- name: mm_dirtier
51
- prerelease: false
52
- version_requirements: *id002
52
+ requirement: *id002
53
53
  - !ruby/object:Gem::Dependency
54
- requirement: &id003 !ruby/object:Gem::Requirement
54
+ type: :development
55
+ name: rake
56
+ prerelease: false
57
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
58
  none: false
56
59
  requirements:
57
60
  - - ">="
@@ -60,12 +63,12 @@ dependencies:
60
63
  segments:
61
64
  - 0
62
65
  version: "0"
66
+ requirement: *id003
67
+ - !ruby/object:Gem::Dependency
63
68
  type: :development
64
- name: rake
69
+ name: log_buddy
65
70
  prerelease: false
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- requirement: &id004 !ruby/object:Gem::Requirement
71
+ version_requirements: &id004 !ruby/object:Gem::Requirement
69
72
  none: false
70
73
  requirements:
71
74
  - - ">="
@@ -74,12 +77,12 @@ dependencies:
74
77
  segments:
75
78
  - 0
76
79
  version: "0"
80
+ requirement: *id004
81
+ - !ruby/object:Gem::Dependency
77
82
  type: :development
78
- name: log_buddy
83
+ name: jnunemaker-matchy
79
84
  prerelease: false
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- requirement: &id005 !ruby/object:Gem::Requirement
85
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
86
  none: false
84
87
  requirements:
85
88
  - - ~>
@@ -90,12 +93,12 @@ dependencies:
90
93
  - 4
91
94
  - 0
92
95
  version: 0.4.0
96
+ requirement: *id005
97
+ - !ruby/object:Gem::Dependency
93
98
  type: :development
94
- name: jnunemaker-matchy
99
+ name: shoulda
95
100
  prerelease: false
96
- version_requirements: *id005
97
- - !ruby/object:Gem::Dependency
98
- requirement: &id006 !ruby/object:Gem::Requirement
101
+ version_requirements: &id006 !ruby/object:Gem::Requirement
99
102
  none: false
100
103
  requirements:
101
104
  - - ~>
@@ -105,10 +108,7 @@ dependencies:
105
108
  - 2
106
109
  - 11
107
110
  version: "2.11"
108
- type: :development
109
- name: shoulda
110
- prerelease: false
111
- version_requirements: *id006
111
+ requirement: *id006
112
112
  description:
113
113
  email:
114
114
  - hereiam@sonic.net
@@ -120,24 +120,24 @@ extra_rdoc_files: []
120
120
 
121
121
  files:
122
122
  - lib/mm_partial_update.rb
123
- - lib/mm_partial_update/embedded_collection.rb
124
- - lib/mm_partial_update/extensions.rb
123
+ - lib/mm_partial_update/update_command.rb
125
124
  - lib/mm_partial_update/plugins/document.rb
126
125
  - lib/mm_partial_update/plugins/embedded_document.rb
127
126
  - lib/mm_partial_update/plugins/partial_update.rb
127
+ - lib/mm_partial_update/extensions.rb
128
+ - lib/mm_partial_update/embedded_collection.rb
128
129
  - lib/mm_partial_update/one_embedded_proxy.rb
129
130
  - lib/mm_partial_update/version.rb
130
- - lib/mm_partial_update/update_command.rb
131
131
  - test/callbacks_support.rb
132
- - test/test_helper.rb
133
- - test/test_update_command.rb
134
- - test/functional/plugins/test_embedded_document.rb
132
+ - test/test_mm_partial_update.rb
135
133
  - test/functional/plugins/test_partial_update.rb
136
134
  - test/functional/plugins/test_document.rb
135
+ - test/functional/plugins/test_embedded_document.rb
137
136
  - test/functional/test_update_command.rb
138
- - test/models.rb
139
137
  - test/test_partial_update.rb
140
- - test/test_mm_partial_update.rb
138
+ - test/test_helper.rb
139
+ - test/models.rb
140
+ - test/test_update_command.rb
141
141
  - LICENSE
142
142
  - README.rdoc
143
143
  has_rdoc: true