activerecord 2.3.5 → 2.3.6

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 (90) hide show
  1. data/CHANGELOG +33 -0
  2. data/Rakefile +1 -1
  3. data/examples/performance.sql +85 -0
  4. data/lib/active_record.rb +1 -2
  5. data/lib/active_record/association_preload.rb +9 -2
  6. data/lib/active_record/associations.rb +48 -38
  7. data/lib/active_record/associations/association_collection.rb +15 -11
  8. data/lib/active_record/associations/association_proxy.rb +16 -6
  9. data/lib/active_record/associations/belongs_to_association.rb +11 -1
  10. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +34 -10
  11. data/lib/active_record/associations/has_many_association.rb +5 -0
  12. data/lib/active_record/associations/has_many_through_association.rb +5 -5
  13. data/lib/active_record/associations/has_one_association.rb +10 -1
  14. data/lib/active_record/attribute_methods.rb +5 -1
  15. data/lib/active_record/autosave_association.rb +66 -35
  16. data/lib/active_record/base.rb +77 -36
  17. data/lib/active_record/batches.rb +13 -9
  18. data/lib/active_record/calculations.rb +6 -3
  19. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -3
  20. data/lib/active_record/connection_adapters/abstract/database_limits.rb +57 -0
  21. data/lib/active_record/connection_adapters/abstract/query_cache.rb +1 -1
  22. data/lib/active_record/connection_adapters/abstract/quoting.rb +3 -7
  23. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +1 -1
  24. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +64 -10
  25. data/lib/active_record/connection_adapters/abstract_adapter.rb +2 -0
  26. data/lib/active_record/connection_adapters/mysql_adapter.rb +31 -1
  27. data/lib/active_record/connection_adapters/postgresql_adapter.rb +31 -66
  28. data/lib/active_record/connection_adapters/sqlite_adapter.rb +2 -2
  29. data/lib/active_record/dirty.rb +2 -2
  30. data/lib/active_record/fixtures.rb +1 -0
  31. data/lib/active_record/locking/optimistic.rb +34 -1
  32. data/lib/active_record/migration.rb +5 -0
  33. data/lib/active_record/nested_attributes.rb +64 -52
  34. data/lib/active_record/reflection.rb +66 -1
  35. data/lib/active_record/schema.rb +5 -1
  36. data/lib/active_record/schema_dumper.rb +3 -0
  37. data/lib/active_record/serializers/json_serializer.rb +1 -1
  38. data/lib/active_record/validations.rb +13 -1
  39. data/lib/active_record/version.rb +1 -1
  40. data/test/cases/active_schema_test_mysql.rb +22 -0
  41. data/test/cases/associations/belongs_to_associations_test.rb +13 -0
  42. data/test/cases/associations/eager_load_nested_include_test.rb +8 -7
  43. data/test/cases/associations/eager_test.rb +7 -1
  44. data/test/cases/associations/has_many_associations_test.rb +26 -0
  45. data/test/cases/associations/inverse_associations_test.rb +566 -0
  46. data/test/cases/associations_test.rb +10 -0
  47. data/test/cases/autosave_association_test.rb +86 -10
  48. data/test/cases/base_test.rb +29 -0
  49. data/test/cases/batches_test.rb +20 -0
  50. data/test/cases/calculations_test.rb +2 -3
  51. data/test/cases/encoding_test.rb +6 -0
  52. data/test/cases/finder_test.rb +19 -3
  53. data/test/cases/fixtures_test.rb +5 -0
  54. data/test/cases/json_serialization_test.rb +14 -0
  55. data/test/cases/locking_test.rb +48 -3
  56. data/test/cases/migration_test.rb +115 -0
  57. data/test/cases/modules_test.rb +28 -0
  58. data/test/cases/named_scope_test.rb +1 -1
  59. data/test/cases/nested_attributes_test.rb +239 -7
  60. data/test/cases/query_cache_test.rb +7 -1
  61. data/test/cases/reflection_test.rb +47 -7
  62. data/test/cases/schema_test_postgresql.rb +2 -2
  63. data/test/cases/validations_i18n_test.rb +6 -36
  64. data/test/cases/validations_test.rb +33 -1
  65. data/test/cases/yaml_serialization_test.rb +11 -0
  66. data/test/fixtures/faces.yml +11 -0
  67. data/test/fixtures/fixture_database.sqlite +0 -0
  68. data/test/fixtures/fixture_database.sqlite3 +0 -0
  69. data/test/fixtures/fixture_database_2.sqlite +0 -0
  70. data/test/fixtures/fixture_database_2.sqlite3 +0 -0
  71. data/test/fixtures/interests.yml +33 -0
  72. data/test/fixtures/men.yml +5 -0
  73. data/test/fixtures/zines.yml +5 -0
  74. data/test/models/author.rb +3 -0
  75. data/test/models/bird.rb +6 -0
  76. data/test/models/company_in_module.rb +17 -0
  77. data/test/models/event_author.rb +5 -0
  78. data/test/models/face.rb +7 -0
  79. data/test/models/interest.rb +5 -0
  80. data/test/models/invoice.rb +4 -0
  81. data/test/models/line_item.rb +3 -0
  82. data/test/models/man.rb +9 -0
  83. data/test/models/parrot.rb +6 -0
  84. data/test/models/pirate.rb +10 -0
  85. data/test/models/ship.rb +10 -1
  86. data/test/models/ship_part.rb +3 -1
  87. data/test/models/zine.rb +3 -0
  88. data/test/schema/schema.rb +41 -0
  89. metadata +37 -11
  90. data/lib/active_record/i18n_interpolation_deprecation.rb +0 -26
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 3
8
+ - 6
9
+ version: 2.3.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - David Heinemeier Hansson
@@ -9,19 +14,23 @@ autorequire: active_record
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-11-27 00:00:00 +13:00
17
+ date: 2010-05-23 00:00:00 -07:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: activesupport
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - "="
22
26
  - !ruby/object:Gem::Version
23
- version: 2.3.5
24
- version:
27
+ segments:
28
+ - 2
29
+ - 3
30
+ - 6
31
+ version: 2.3.6
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  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
35
  email: david@loudthinking.com
27
36
  executables: []
@@ -56,6 +65,7 @@ files:
56
65
  - lib/active_record/callbacks.rb
57
66
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
58
67
  - lib/active_record/connection_adapters/abstract/connection_specification.rb
68
+ - lib/active_record/connection_adapters/abstract/database_limits.rb
59
69
  - lib/active_record/connection_adapters/abstract/database_statements.rb
60
70
  - lib/active_record/connection_adapters/abstract/query_cache.rb
61
71
  - lib/active_record/connection_adapters/abstract/quoting.rb
@@ -70,7 +80,6 @@ files:
70
80
  - lib/active_record/dynamic_finder_match.rb
71
81
  - lib/active_record/dynamic_scope_match.rb
72
82
  - lib/active_record/fixtures.rb
73
- - lib/active_record/i18n_interpolation_deprecation.rb
74
83
  - lib/active_record/locale/en.yml
75
84
  - lib/active_record/locking/optimistic.rb
76
85
  - lib/active_record/locking/pessimistic.rb
@@ -116,6 +125,7 @@ files:
116
125
  - test/cases/associations/has_one_associations_test.rb
117
126
  - test/cases/associations/has_one_through_associations_test.rb
118
127
  - test/cases/associations/inner_join_association_test.rb
128
+ - test/cases/associations/inverse_associations_test.rb
119
129
  - test/cases/associations/join_model_test.rb
120
130
  - test/cases/associations_test.rb
121
131
  - test/cases/attribute_methods_test.rb
@@ -140,6 +150,7 @@ files:
140
150
  - test/cases/defaults_test.rb
141
151
  - test/cases/deprecated_finder_test.rb
142
152
  - test/cases/dirty_test.rb
153
+ - test/cases/encoding_test.rb
143
154
  - test/cases/finder_respond_to_test.rb
144
155
  - test/cases/finder_test.rb
145
156
  - test/cases/fixtures_test.rb
@@ -178,6 +189,7 @@ files:
178
189
  - test/cases/validations_i18n_test.rb
179
190
  - test/cases/validations_test.rb
180
191
  - test/cases/xml_serialization_test.rb
192
+ - test/cases/yaml_serialization_test.rb
181
193
  - test/config.rb
182
194
  - test/connections/jdbc_jdbcderby/connection.rb
183
195
  - test/connections/jdbc_jdbch2/connection.rb
@@ -221,6 +233,7 @@ files:
221
233
  - test/fixtures/developers_projects.yml
222
234
  - test/fixtures/edges.yml
223
235
  - test/fixtures/entrants.yml
236
+ - test/fixtures/faces.yml
224
237
  - test/fixtures/fixture_database.sqlite
225
238
  - test/fixtures/fixture_database.sqlite3
226
239
  - test/fixtures/fixture_database_2.sqlite
@@ -228,6 +241,7 @@ files:
228
241
  - test/fixtures/fk_test_has_fk.yml
229
242
  - test/fixtures/fk_test_has_pk.yml
230
243
  - test/fixtures/funny_jokes.yml
244
+ - test/fixtures/interests.yml
231
245
  - test/fixtures/items.yml
232
246
  - test/fixtures/jobs.yml
233
247
  - test/fixtures/legacy_things.yml
@@ -235,6 +249,7 @@ files:
235
249
  - test/fixtures/member_types.yml
236
250
  - test/fixtures/members.yml
237
251
  - test/fixtures/memberships.yml
252
+ - test/fixtures/men.yml
238
253
  - test/fixtures/minimalistics.yml
239
254
  - test/fixtures/mixed_case_monkeys.yml
240
255
  - test/fixtures/mixins.yml
@@ -272,6 +287,7 @@ files:
272
287
  - test/fixtures/treasures.yml
273
288
  - test/fixtures/vertices.yml
274
289
  - test/fixtures/warehouse-things.yml
290
+ - test/fixtures/zines.yml
275
291
  - test/migrations/broken/100_migration_that_raises_exception.rb
276
292
  - test/migrations/decimal/1_give_me_big_numbers.rb
277
293
  - test/migrations/duplicate/1_people_have_last_names.rb
@@ -317,12 +333,18 @@ files:
317
333
  - test/models/entrant.rb
318
334
  - test/models/essay.rb
319
335
  - test/models/event.rb
336
+ - test/models/event_author.rb
337
+ - test/models/face.rb
320
338
  - test/models/guid.rb
339
+ - test/models/interest.rb
340
+ - test/models/invoice.rb
321
341
  - test/models/item.rb
322
342
  - test/models/job.rb
323
343
  - test/models/joke.rb
324
344
  - test/models/keyboard.rb
325
345
  - test/models/legacy_thing.rb
346
+ - test/models/line_item.rb
347
+ - test/models/man.rb
326
348
  - test/models/matey.rb
327
349
  - test/models/member.rb
328
350
  - test/models/member_detail.rb
@@ -358,6 +380,7 @@ files:
358
380
  - test/models/treasure.rb
359
381
  - test/models/vertex.rb
360
382
  - test/models/warehouse_thing.rb
383
+ - test/models/zine.rb
361
384
  - test/schema/mysql_specific_schema.rb
362
385
  - test/schema/postgresql_specific_schema.rb
363
386
  - test/schema/schema.rb
@@ -365,6 +388,7 @@ files:
365
388
  - test/schema/sqlite_specific_schema.rb
366
389
  - examples/associations.png
367
390
  - examples/performance.rb
391
+ - examples/performance.sql
368
392
  has_rdoc: true
369
393
  homepage: http://www.rubyonrails.org
370
394
  licenses: []
@@ -379,18 +403,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
379
403
  requirements:
380
404
  - - ">="
381
405
  - !ruby/object:Gem::Version
406
+ segments:
407
+ - 0
382
408
  version: "0"
383
- version:
384
409
  required_rubygems_version: !ruby/object:Gem::Requirement
385
410
  requirements:
386
411
  - - ">="
387
412
  - !ruby/object:Gem::Version
413
+ segments:
414
+ - 0
388
415
  version: "0"
389
- version:
390
416
  requirements: []
391
417
 
392
418
  rubyforge_project: activerecord
393
- rubygems_version: 1.3.5
419
+ rubygems_version: 1.3.6
394
420
  signing_key:
395
421
  specification_version: 3
396
422
  summary: Implements the ActiveRecord pattern for ORM.
@@ -1,26 +0,0 @@
1
- # Deprecates the use of the former message interpolation syntax in activerecord
2
- # as in "must have %d characters". The new syntax uses explicit variable names
3
- # as in "{{value}} must have {{count}} characters".
4
-
5
- require 'i18n/backend/simple'
6
- module I18n
7
- module Backend
8
- class Simple
9
- DEPRECATED_INTERPOLATORS = { '%d' => '{{count}}', '%s' => '{{value}}' }
10
-
11
- protected
12
- def interpolate_with_deprecated_syntax(locale, string, values = {})
13
- return string unless string.is_a?(String) && !values.empty?
14
-
15
- string = string.gsub(/%d|%s/) do |s|
16
- instead = DEPRECATED_INTERPOLATORS[s]
17
- ActiveSupport::Deprecation.warn "using #{s} in messages is deprecated; use #{instead} instead."
18
- instead
19
- end
20
-
21
- interpolate_without_deprecated_syntax(locale, string, values)
22
- end
23
- alias_method_chain :interpolate, :deprecated_syntax
24
- end
25
- end
26
- end