tenacity 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/history.txt +6 -0
- data/lib/tenacity/instance_methods.rb +4 -1
- data/lib/tenacity/orm_ext/mongo_mapper.rb +1 -1
- data/lib/tenacity/version.rb +1 -1
- data/tenacity.gemspec +2 -2
- metadata +15 -31
data/Gemfile
CHANGED
data/history.txt
CHANGED
@@ -13,7 +13,10 @@ module Tenacity
|
|
13
13
|
autosave_save_or_destroy(associate) unless associate.nil?
|
14
14
|
elsif association.type == :t_has_many
|
15
15
|
associates = instance_variable_get(_t_ivar_name(association))
|
16
|
-
|
16
|
+
unless associates.nil?
|
17
|
+
associates.each { |associate| autosave_save_or_destroy(associate) }
|
18
|
+
instance_variable_set(_t_ivar_name(association), associates.reject { |associate| associate.marked_for_destruction? })
|
19
|
+
end
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
@@ -76,7 +76,7 @@ module Tenacity
|
|
76
76
|
def _t_initialize_has_many_association(association)
|
77
77
|
unless self.respond_to?(association.foreign_keys_property)
|
78
78
|
key association.foreign_keys_property, Array
|
79
|
-
after_save { |record| _t_save_associates(record, association) }
|
79
|
+
after_save { |record| record.class._t_save_associates(record, association) }
|
80
80
|
after_destroy { |record| record._t_cleanup_has_many_association(association) }
|
81
81
|
end
|
82
82
|
end
|
data/lib/tenacity/version.rb
CHANGED
data/tenacity.gemspec
CHANGED
@@ -33,8 +33,8 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency "sequel", "~> 3.19.0"
|
34
34
|
|
35
35
|
# MongoDB
|
36
|
-
|
37
|
-
s.add_development_dependency "bson_ext", "~> 1.
|
36
|
+
# mongo_mapper dependency defined in Gemfile
|
37
|
+
s.add_development_dependency "bson_ext", "~> 1.3.0"
|
38
38
|
s.add_development_dependency "mongoid", "~> 2.0.0.beta"
|
39
39
|
|
40
40
|
# CouchDB
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenacity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Wood
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-05 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -210,7 +210,7 @@ dependencies:
|
|
210
210
|
version: 3.19.0
|
211
211
|
version_requirements: *id012
|
212
212
|
- !ruby/object:Gem::Dependency
|
213
|
-
name:
|
213
|
+
name: bson_ext
|
214
214
|
prerelease: false
|
215
215
|
type: :development
|
216
216
|
requirement: &id013 !ruby/object:Gem::Requirement
|
@@ -218,34 +218,18 @@ dependencies:
|
|
218
218
|
requirements:
|
219
219
|
- - ~>
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
hash:
|
221
|
+
hash: 27
|
222
222
|
segments:
|
223
|
+
- 1
|
224
|
+
- 3
|
223
225
|
- 0
|
224
|
-
|
225
|
-
- 6
|
226
|
-
version: 0.8.6
|
226
|
+
version: 1.3.0
|
227
227
|
version_requirements: *id013
|
228
|
-
- !ruby/object:Gem::Dependency
|
229
|
-
name: bson_ext
|
230
|
-
prerelease: false
|
231
|
-
type: :development
|
232
|
-
requirement: &id014 !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
|
-
requirements:
|
235
|
-
- - ~>
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
hash: 23
|
238
|
-
segments:
|
239
|
-
- 1
|
240
|
-
- 2
|
241
|
-
- 4
|
242
|
-
version: 1.2.4
|
243
|
-
version_requirements: *id014
|
244
228
|
- !ruby/object:Gem::Dependency
|
245
229
|
name: mongoid
|
246
230
|
prerelease: false
|
247
231
|
type: :development
|
248
|
-
requirement: &
|
232
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
249
233
|
none: false
|
250
234
|
requirements:
|
251
235
|
- - ~>
|
@@ -257,12 +241,12 @@ dependencies:
|
|
257
241
|
- 0
|
258
242
|
- beta
|
259
243
|
version: 2.0.0.beta
|
260
|
-
version_requirements: *
|
244
|
+
version_requirements: *id014
|
261
245
|
- !ruby/object:Gem::Dependency
|
262
246
|
name: couchrest
|
263
247
|
prerelease: false
|
264
248
|
type: :development
|
265
|
-
requirement: &
|
249
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
266
250
|
none: false
|
267
251
|
requirements:
|
268
252
|
- - ~>
|
@@ -273,12 +257,12 @@ dependencies:
|
|
273
257
|
- 0
|
274
258
|
- 0
|
275
259
|
version: 1.0.0
|
276
|
-
version_requirements: *
|
260
|
+
version_requirements: *id015
|
277
261
|
- !ruby/object:Gem::Dependency
|
278
262
|
name: couchrest_model
|
279
263
|
prerelease: false
|
280
264
|
type: :development
|
281
|
-
requirement: &
|
265
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
282
266
|
none: false
|
283
267
|
requirements:
|
284
268
|
- - ~>
|
@@ -290,7 +274,7 @@ dependencies:
|
|
290
274
|
- 0
|
291
275
|
- beta
|
292
276
|
version: 1.0.0.beta
|
293
|
-
version_requirements: *
|
277
|
+
version_requirements: *id016
|
294
278
|
description: Tenacity provides a database client independent way of specifying simple relationships between models backed by different databases.
|
295
279
|
email:
|
296
280
|
- john@johnpwood.net
|