activerecord 2.2.3 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

Files changed (120) hide show
  1. data/CHANGELOG +438 -396
  2. data/Rakefile +4 -2
  3. data/lib/active_record.rb +46 -43
  4. data/lib/active_record/association_preload.rb +34 -19
  5. data/lib/active_record/associations.rb +193 -251
  6. data/lib/active_record/associations/association_collection.rb +38 -21
  7. data/lib/active_record/associations/association_proxy.rb +11 -4
  8. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +2 -2
  9. data/lib/active_record/associations/has_many_association.rb +2 -2
  10. data/lib/active_record/associations/has_many_through_association.rb +8 -8
  11. data/lib/active_record/associations/has_one_association.rb +11 -2
  12. data/lib/active_record/attribute_methods.rb +1 -0
  13. data/lib/active_record/autosave_association.rb +349 -0
  14. data/lib/active_record/base.rb +292 -106
  15. data/lib/active_record/batches.rb +73 -0
  16. data/lib/active_record/calculations.rb +34 -16
  17. data/lib/active_record/callbacks.rb +37 -8
  18. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +16 -0
  19. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -0
  20. data/lib/active_record/connection_adapters/abstract/database_statements.rb +103 -15
  21. data/lib/active_record/connection_adapters/abstract/query_cache.rb +6 -6
  22. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +28 -25
  23. data/lib/active_record/connection_adapters/abstract_adapter.rb +29 -5
  24. data/lib/active_record/connection_adapters/mysql_adapter.rb +50 -21
  25. data/lib/active_record/connection_adapters/postgresql_adapter.rb +26 -41
  26. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
  27. data/lib/active_record/connection_adapters/sqlite_adapter.rb +41 -21
  28. data/lib/active_record/dirty.rb +1 -1
  29. data/lib/active_record/dynamic_scope_match.rb +25 -0
  30. data/lib/active_record/fixtures.rb +193 -198
  31. data/lib/active_record/locale/en.yml +1 -1
  32. data/lib/active_record/locking/optimistic.rb +33 -0
  33. data/lib/active_record/migration.rb +8 -2
  34. data/lib/active_record/named_scope.rb +13 -6
  35. data/lib/active_record/nested_attributes.rb +329 -0
  36. data/lib/active_record/query_cache.rb +25 -13
  37. data/lib/active_record/reflection.rb +6 -1
  38. data/lib/active_record/schema_dumper.rb +2 -0
  39. data/lib/active_record/serialization.rb +3 -1
  40. data/lib/active_record/serializers/json_serializer.rb +19 -0
  41. data/lib/active_record/serializers/xml_serializer.rb +28 -13
  42. data/lib/active_record/session_store.rb +318 -0
  43. data/lib/active_record/test_case.rb +15 -9
  44. data/lib/active_record/timestamp.rb +2 -2
  45. data/lib/active_record/transactions.rb +58 -8
  46. data/lib/active_record/validations.rb +29 -24
  47. data/lib/active_record/version.rb +2 -2
  48. data/test/cases/ar_schema_test.rb +0 -1
  49. data/test/cases/associations/belongs_to_associations_test.rb +35 -131
  50. data/test/cases/associations/cascaded_eager_loading_test.rb +8 -0
  51. data/test/cases/associations/eager_load_nested_include_test.rb +29 -0
  52. data/test/cases/associations/eager_test.rb +137 -7
  53. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +45 -7
  54. data/test/cases/associations/has_many_associations_test.rb +110 -149
  55. data/test/cases/associations/has_many_through_associations_test.rb +39 -7
  56. data/test/cases/associations/has_one_associations_test.rb +39 -92
  57. data/test/cases/associations/has_one_through_associations_test.rb +34 -3
  58. data/test/cases/associations/inner_join_association_test.rb +0 -5
  59. data/test/cases/associations/join_model_test.rb +5 -7
  60. data/test/cases/attribute_methods_test.rb +13 -1
  61. data/test/cases/autosave_association_test.rb +901 -0
  62. data/test/cases/base_test.rb +41 -21
  63. data/test/cases/batches_test.rb +61 -0
  64. data/test/cases/calculations_test.rb +37 -17
  65. data/test/cases/callbacks_test.rb +43 -5
  66. data/test/cases/connection_pool_test.rb +25 -0
  67. data/test/cases/copy_table_test_sqlite.rb +11 -0
  68. data/test/cases/datatype_test_postgresql.rb +1 -0
  69. data/test/cases/defaults_test.rb +37 -26
  70. data/test/cases/dirty_test.rb +26 -2
  71. data/test/cases/finder_test.rb +79 -44
  72. data/test/cases/fixtures_test.rb +15 -19
  73. data/test/cases/helper.rb +26 -19
  74. data/test/cases/inheritance_test.rb +2 -2
  75. data/test/cases/json_serialization_test.rb +1 -1
  76. data/test/cases/locking_test.rb +23 -5
  77. data/test/cases/method_scoping_test.rb +126 -3
  78. data/test/cases/migration_test.rb +253 -237
  79. data/test/cases/named_scope_test.rb +73 -3
  80. data/test/cases/nested_attributes_test.rb +509 -0
  81. data/test/cases/query_cache_test.rb +0 -4
  82. data/test/cases/reflection_test.rb +13 -3
  83. data/test/cases/reload_models_test.rb +3 -1
  84. data/test/cases/repair_helper.rb +50 -0
  85. data/test/cases/schema_dumper_test.rb +0 -1
  86. data/test/cases/transactions_test.rb +177 -12
  87. data/test/cases/validations_i18n_test.rb +288 -294
  88. data/test/cases/validations_test.rb +230 -180
  89. data/test/cases/xml_serialization_test.rb +19 -1
  90. data/test/fixtures/fixture_database.sqlite3 +0 -0
  91. data/test/fixtures/fixture_database_2.sqlite3 +0 -0
  92. data/test/fixtures/member_types.yml +6 -0
  93. data/test/fixtures/members.yml +3 -1
  94. data/test/fixtures/people.yml +10 -1
  95. data/test/fixtures/toys.yml +4 -0
  96. data/test/models/author.rb +1 -2
  97. data/test/models/bird.rb +3 -0
  98. data/test/models/category.rb +1 -0
  99. data/test/models/company.rb +3 -0
  100. data/test/models/developer.rb +12 -0
  101. data/test/models/event.rb +3 -0
  102. data/test/models/member.rb +1 -0
  103. data/test/models/member_detail.rb +1 -0
  104. data/test/models/member_type.rb +3 -0
  105. data/test/models/owner.rb +2 -1
  106. data/test/models/parrot.rb +2 -0
  107. data/test/models/person.rb +6 -0
  108. data/test/models/pet.rb +2 -1
  109. data/test/models/pirate.rb +55 -1
  110. data/test/models/post.rb +6 -0
  111. data/test/models/project.rb +1 -0
  112. data/test/models/reply.rb +6 -0
  113. data/test/models/ship.rb +8 -1
  114. data/test/models/ship_part.rb +5 -0
  115. data/test/models/topic.rb +13 -1
  116. data/test/models/toy.rb +4 -0
  117. data/test/schema/schema.rb +35 -2
  118. metadata +70 -9
  119. data/test/fixtures/fixture_database.sqlite +0 -0
  120. data/test/fixtures/fixture_database_2.sqlite +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ autorequire: active_record
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-28 00:00:00 +13:00
12
+ date: 2009-03-15 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.2.3
23
+ version: 2.3.2
24
24
  version:
25
25
  description: Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.
26
26
  email: david@loudthinking.com
@@ -36,8 +36,10 @@ files:
36
36
  - README
37
37
  - RUNNING_UNIT_TESTS
38
38
  - CHANGELOG
39
+ - lib/active_record
39
40
  - lib/active_record/aggregations.rb
40
41
  - lib/active_record/association_preload.rb
42
+ - lib/active_record/associations
41
43
  - lib/active_record/associations/association_collection.rb
42
44
  - lib/active_record/associations/association_proxy.rb
43
45
  - lib/active_record/associations/belongs_to_association.rb
@@ -49,9 +51,13 @@ files:
49
51
  - lib/active_record/associations/has_one_through_association.rb
50
52
  - lib/active_record/associations.rb
51
53
  - lib/active_record/attribute_methods.rb
54
+ - lib/active_record/autosave_association.rb
52
55
  - lib/active_record/base.rb
56
+ - lib/active_record/batches.rb
53
57
  - lib/active_record/calculations.rb
54
58
  - lib/active_record/callbacks.rb
59
+ - lib/active_record/connection_adapters
60
+ - lib/active_record/connection_adapters/abstract
55
61
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
56
62
  - lib/active_record/connection_adapters/abstract/connection_specification.rb
57
63
  - lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -66,21 +72,27 @@ files:
66
72
  - lib/active_record/connection_adapters/sqlite_adapter.rb
67
73
  - lib/active_record/dirty.rb
68
74
  - lib/active_record/dynamic_finder_match.rb
75
+ - lib/active_record/dynamic_scope_match.rb
69
76
  - lib/active_record/fixtures.rb
70
77
  - lib/active_record/i18n_interpolation_deprecation.rb
78
+ - lib/active_record/locale
71
79
  - lib/active_record/locale/en.yml
80
+ - lib/active_record/locking
72
81
  - lib/active_record/locking/optimistic.rb
73
82
  - lib/active_record/locking/pessimistic.rb
74
83
  - lib/active_record/migration.rb
75
84
  - lib/active_record/named_scope.rb
85
+ - lib/active_record/nested_attributes.rb
76
86
  - lib/active_record/observer.rb
77
87
  - lib/active_record/query_cache.rb
78
88
  - lib/active_record/reflection.rb
79
89
  - lib/active_record/schema.rb
80
90
  - lib/active_record/schema_dumper.rb
81
91
  - lib/active_record/serialization.rb
92
+ - lib/active_record/serializers
82
93
  - lib/active_record/serializers/json_serializer.rb
83
94
  - lib/active_record/serializers/xml_serializer.rb
95
+ - lib/active_record/session_store.rb
84
96
  - lib/active_record/test_case.rb
85
97
  - lib/active_record/timestamp.rb
86
98
  - lib/active_record/transactions.rb
@@ -88,14 +100,17 @@ files:
88
100
  - lib/active_record/version.rb
89
101
  - lib/active_record.rb
90
102
  - lib/activerecord.rb
103
+ - test/assets
91
104
  - test/assets/example.log
92
105
  - test/assets/flowers.jpg
106
+ - test/cases
93
107
  - test/cases/aaa_create_tables_test.rb
94
108
  - test/cases/active_schema_test_mysql.rb
95
109
  - test/cases/active_schema_test_postgresql.rb
96
110
  - test/cases/adapter_test.rb
97
111
  - test/cases/aggregations_test.rb
98
112
  - test/cases/ar_schema_test.rb
113
+ - test/cases/associations
99
114
  - test/cases/associations/belongs_to_associations_test.rb
100
115
  - test/cases/associations/callbacks_test.rb
101
116
  - test/cases/associations/cascaded_eager_loading_test.rb
@@ -113,7 +128,9 @@ files:
113
128
  - test/cases/associations/join_model_test.rb
114
129
  - test/cases/associations_test.rb
115
130
  - test/cases/attribute_methods_test.rb
131
+ - test/cases/autosave_association_test.rb
116
132
  - test/cases/base_test.rb
133
+ - test/cases/batches_test.rb
117
134
  - test/cases/binary_test.rb
118
135
  - test/cases/calculations_test.rb
119
136
  - test/cases/callbacks_observers_test.rb
@@ -121,6 +138,7 @@ files:
121
138
  - test/cases/class_inheritable_attributes_test.rb
122
139
  - test/cases/column_alias_test.rb
123
140
  - test/cases/column_definition_test.rb
141
+ - test/cases/connection_pool_test.rb
124
142
  - test/cases/connection_test_firebird.rb
125
143
  - test/cases/connection_test_mysql.rb
126
144
  - test/cases/copy_table_test_sqlite.rb
@@ -148,12 +166,14 @@ files:
148
166
  - test/cases/modules_test.rb
149
167
  - test/cases/multiple_db_test.rb
150
168
  - test/cases/named_scope_test.rb
169
+ - test/cases/nested_attributes_test.rb
151
170
  - test/cases/pk_test.rb
152
171
  - test/cases/pooled_connections_test.rb
153
172
  - test/cases/query_cache_test.rb
154
173
  - test/cases/readonly_test.rb
155
174
  - test/cases/reflection_test.rb
156
175
  - test/cases/reload_models_test.rb
176
+ - test/cases/repair_helper.rb
157
177
  - test/cases/reserved_word_test_mysql.rb
158
178
  - test/cases/sanitize_test.rb
159
179
  - test/cases/schema_authorization_test_postgresql.rb
@@ -167,24 +187,43 @@ files:
167
187
  - test/cases/validations_test.rb
168
188
  - test/cases/xml_serialization_test.rb
169
189
  - test/config.rb
190
+ - test/connections
191
+ - test/connections/jdbc_jdbcderby
170
192
  - test/connections/jdbc_jdbcderby/connection.rb
193
+ - test/connections/jdbc_jdbch2
171
194
  - test/connections/jdbc_jdbch2/connection.rb
195
+ - test/connections/jdbc_jdbchsqldb
172
196
  - test/connections/jdbc_jdbchsqldb/connection.rb
197
+ - test/connections/jdbc_jdbcmysql
173
198
  - test/connections/jdbc_jdbcmysql/connection.rb
199
+ - test/connections/jdbc_jdbcpostgresql
174
200
  - test/connections/jdbc_jdbcpostgresql/connection.rb
201
+ - test/connections/jdbc_jdbcsqlite3
175
202
  - test/connections/jdbc_jdbcsqlite3/connection.rb
203
+ - test/connections/native_db2
176
204
  - test/connections/native_db2/connection.rb
205
+ - test/connections/native_firebird
177
206
  - test/connections/native_firebird/connection.rb
207
+ - test/connections/native_frontbase
178
208
  - test/connections/native_frontbase/connection.rb
209
+ - test/connections/native_mysql
179
210
  - test/connections/native_mysql/connection.rb
211
+ - test/connections/native_openbase
180
212
  - test/connections/native_openbase/connection.rb
213
+ - test/connections/native_oracle
181
214
  - test/connections/native_oracle/connection.rb
215
+ - test/connections/native_postgresql
182
216
  - test/connections/native_postgresql/connection.rb
217
+ - test/connections/native_sqlite
183
218
  - test/connections/native_sqlite/connection.rb
219
+ - test/connections/native_sqlite3
184
220
  - test/connections/native_sqlite3/connection.rb
185
221
  - test/connections/native_sqlite3/in_memory_connection.rb
222
+ - test/connections/native_sybase
186
223
  - test/connections/native_sybase/connection.rb
224
+ - test/fixtures
187
225
  - test/fixtures/accounts.yml
226
+ - test/fixtures/all
188
227
  - test/fixtures/all/developers.yml
189
228
  - test/fixtures/all/people.csv
190
229
  - test/fixtures/all/tasks.yml
@@ -193,7 +232,9 @@ files:
193
232
  - test/fixtures/authors.yml
194
233
  - test/fixtures/binaries.yml
195
234
  - test/fixtures/books.yml
235
+ - test/fixtures/categories
196
236
  - test/fixtures/categories/special_categories.yml
237
+ - test/fixtures/categories/subsubdir
197
238
  - test/fixtures/categories/subsubdir/arbitrary_filename.yml
198
239
  - test/fixtures/categories.yml
199
240
  - test/fixtures/categories_ordered.yml
@@ -209,9 +250,7 @@ files:
209
250
  - test/fixtures/developers_projects.yml
210
251
  - test/fixtures/edges.yml
211
252
  - test/fixtures/entrants.yml
212
- - test/fixtures/fixture_database.sqlite
213
253
  - test/fixtures/fixture_database.sqlite3
214
- - test/fixtures/fixture_database_2.sqlite
215
254
  - test/fixtures/fixture_database_2.sqlite3
216
255
  - test/fixtures/fk_test_has_fk.yml
217
256
  - test/fixtures/fk_test_has_pk.yml
@@ -220,13 +259,17 @@ files:
220
259
  - test/fixtures/jobs.yml
221
260
  - test/fixtures/legacy_things.yml
222
261
  - test/fixtures/mateys.yml
262
+ - test/fixtures/member_types.yml
223
263
  - test/fixtures/members.yml
224
264
  - test/fixtures/memberships.yml
225
265
  - test/fixtures/minimalistics.yml
226
266
  - test/fixtures/mixed_case_monkeys.yml
227
267
  - test/fixtures/mixins.yml
228
268
  - test/fixtures/movies.yml
269
+ - test/fixtures/naked
270
+ - test/fixtures/naked/csv
229
271
  - test/fixtures/naked/csv/accounts.csv
272
+ - test/fixtures/naked/yml
230
273
  - test/fixtures/naked/yml/accounts.yml
231
274
  - test/fixtures/naked/yml/companies.yml
232
275
  - test/fixtures/naked/yml/courses.yml
@@ -242,6 +285,7 @@ files:
242
285
  - test/fixtures/projects.yml
243
286
  - test/fixtures/readers.yml
244
287
  - test/fixtures/references.yml
288
+ - test/fixtures/reserved_words
245
289
  - test/fixtures/reserved_words/distinct.yml
246
290
  - test/fixtures/reserved_words/distincts_selects.yml
247
291
  - test/fixtures/reserved_words/group.yml
@@ -255,33 +299,47 @@ files:
255
299
  - test/fixtures/tags.yml
256
300
  - test/fixtures/tasks.yml
257
301
  - test/fixtures/topics.yml
302
+ - test/fixtures/toys.yml
258
303
  - test/fixtures/treasures.yml
259
304
  - test/fixtures/vertices.yml
260
305
  - test/fixtures/warehouse-things.yml
306
+ - test/migrations
307
+ - test/migrations/broken
261
308
  - test/migrations/broken/100_migration_that_raises_exception.rb
309
+ - test/migrations/decimal
262
310
  - test/migrations/decimal/1_give_me_big_numbers.rb
311
+ - test/migrations/duplicate
263
312
  - test/migrations/duplicate/1_people_have_last_names.rb
264
313
  - test/migrations/duplicate/2_we_need_reminders.rb
265
314
  - test/migrations/duplicate/3_foo.rb
266
315
  - test/migrations/duplicate/3_innocent_jointable.rb
316
+ - test/migrations/duplicate_names
267
317
  - test/migrations/duplicate_names/20080507052938_chunky.rb
268
318
  - test/migrations/duplicate_names/20080507053028_chunky.rb
319
+ - test/migrations/interleaved
320
+ - test/migrations/interleaved/pass_1
269
321
  - test/migrations/interleaved/pass_1/3_innocent_jointable.rb
322
+ - test/migrations/interleaved/pass_2
270
323
  - test/migrations/interleaved/pass_2/1_people_have_last_names.rb
271
324
  - test/migrations/interleaved/pass_2/3_innocent_jointable.rb
325
+ - test/migrations/interleaved/pass_3
272
326
  - test/migrations/interleaved/pass_3/1_people_have_last_names.rb
273
327
  - test/migrations/interleaved/pass_3/2_i_raise_on_down.rb
274
328
  - test/migrations/interleaved/pass_3/3_innocent_jointable.rb
329
+ - test/migrations/missing
275
330
  - test/migrations/missing/1000_people_have_middle_names.rb
276
331
  - test/migrations/missing/1_people_have_last_names.rb
277
332
  - test/migrations/missing/3_we_need_reminders.rb
278
333
  - test/migrations/missing/4_innocent_jointable.rb
334
+ - test/migrations/valid
279
335
  - test/migrations/valid/1_people_have_last_names.rb
280
336
  - test/migrations/valid/2_we_need_reminders.rb
281
337
  - test/migrations/valid/3_innocent_jointable.rb
338
+ - test/models
282
339
  - test/models/author.rb
283
340
  - test/models/auto_id.rb
284
341
  - test/models/binary.rb
342
+ - test/models/bird.rb
285
343
  - test/models/book.rb
286
344
  - test/models/categorization.rb
287
345
  - test/models/category.rb
@@ -299,6 +357,7 @@ files:
299
357
  - test/models/developer.rb
300
358
  - test/models/edge.rb
301
359
  - test/models/entrant.rb
360
+ - test/models/event.rb
302
361
  - test/models/guid.rb
303
362
  - test/models/item.rb
304
363
  - test/models/job.rb
@@ -308,6 +367,7 @@ files:
308
367
  - test/models/matey.rb
309
368
  - test/models/member.rb
310
369
  - test/models/member_detail.rb
370
+ - test/models/member_type.rb
311
371
  - test/models/membership.rb
312
372
  - test/models/minimalistic.rb
313
373
  - test/models/mixed_case_monkey.rb
@@ -326,6 +386,7 @@ files:
326
386
  - test/models/reference.rb
327
387
  - test/models/reply.rb
328
388
  - test/models/ship.rb
389
+ - test/models/ship_part.rb
329
390
  - test/models/sponsor.rb
330
391
  - test/models/subject.rb
331
392
  - test/models/subscriber.rb
@@ -334,9 +395,11 @@ files:
334
395
  - test/models/tagging.rb
335
396
  - test/models/task.rb
336
397
  - test/models/topic.rb
398
+ - test/models/toy.rb
337
399
  - test/models/treasure.rb
338
400
  - test/models/vertex.rb
339
401
  - test/models/warehouse_thing.rb
402
+ - test/schema
340
403
  - test/schema/mysql_specific_schema.rb
341
404
  - test/schema/postgresql_specific_schema.rb
342
405
  - test/schema/schema.rb
@@ -345,8 +408,6 @@ files:
345
408
  - examples/associations.png
346
409
  has_rdoc: true
347
410
  homepage: http://www.rubyonrails.org
348
- licenses: []
349
-
350
411
  post_install_message:
351
412
  rdoc_options:
352
413
  - --main
@@ -368,9 +429,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
429
  requirements: []
369
430
 
370
431
  rubyforge_project: activerecord
371
- rubygems_version: 1.3.2
432
+ rubygems_version: 1.3.1
372
433
  signing_key:
373
- specification_version: 3
434
+ specification_version: 2
374
435
  summary: Implements the ActiveRecord pattern for ORM.
375
436
  test_files: []
376
437