composite_primary_keys 7.0.13 → 7.0.14

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/History.rdoc +615 -608
  3. data/lib/composite_primary_keys.rb +110 -110
  4. data/lib/composite_primary_keys/associations/association.rb +23 -23
  5. data/lib/composite_primary_keys/associations/association_scope.rb +77 -77
  6. data/lib/composite_primary_keys/associations/has_and_belongs_to_many_association.rb +59 -59
  7. data/lib/composite_primary_keys/associations/has_many_association.rb +56 -56
  8. data/lib/composite_primary_keys/associations/join_dependency.rb +89 -89
  9. data/lib/composite_primary_keys/associations/join_dependency/join_part.rb +38 -38
  10. data/lib/composite_primary_keys/associations/preloader/association.rb +78 -78
  11. data/lib/composite_primary_keys/associations/preloader/has_and_belongs_to_many.rb +46 -46
  12. data/lib/composite_primary_keys/attribute_methods/dirty.rb +26 -26
  13. data/lib/composite_primary_keys/attribute_methods/read.rb +34 -34
  14. data/lib/composite_primary_keys/attribute_methods/write.rb +36 -36
  15. data/lib/composite_primary_keys/base.rb +0 -6
  16. data/lib/composite_primary_keys/composite_arrays.rb +30 -30
  17. data/lib/composite_primary_keys/connection_adapters/abstract/connection_specification_changes.rb +4 -2
  18. data/lib/composite_primary_keys/connection_adapters/sqlserver_adapter.rb +17 -0
  19. data/lib/composite_primary_keys/core.rb +47 -47
  20. data/lib/composite_primary_keys/persistence.rb +60 -60
  21. data/lib/composite_primary_keys/relation.rb +56 -56
  22. data/lib/composite_primary_keys/relation/calculations.rb +75 -65
  23. data/lib/composite_primary_keys/relation/finder_methods.rb +196 -196
  24. data/lib/composite_primary_keys/sanitization.rb +52 -52
  25. data/lib/composite_primary_keys/validations/uniqueness.rb +37 -39
  26. data/lib/composite_primary_keys/version.rb +8 -8
  27. data/tasks/databases/sqlserver.rake +40 -27
  28. data/test/connections/databases.example.yml +18 -18
  29. data/test/connections/native_sqlserver/connection.rb +14 -11
  30. data/test/fixtures/db_definitions/mysql.sql +208 -208
  31. data/test/fixtures/db_definitions/postgresql.sql +210 -210
  32. data/test/fixtures/db_definitions/sqlite.sql +197 -197
  33. data/test/fixtures/db_definitions/sqlserver.drop.sql +94 -91
  34. data/test/fixtures/db_definitions/sqlserver.sql +232 -226
  35. data/test/fixtures/employee.rb +5 -5
  36. data/test/test_associations.rb +275 -275
  37. data/test/test_attributes.rb +60 -60
  38. data/test/test_create.rb +112 -112
  39. data/test/test_delete.rb +152 -148
  40. data/test/test_delete_all.rb +21 -21
  41. data/test/test_enum.rb +20 -20
  42. data/test/test_equal.rb +1 -1
  43. data/test/test_tutorial_example.rb +21 -21
  44. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11bd0689a2d8973f43dc85cb073ad159ff3bf928
4
- data.tar.gz: f522a924cbcf3133266412edbc199578d04de126
3
+ metadata.gz: c70848e6827fb3c8454a2de03b225abe8398ef81
4
+ data.tar.gz: 475491e54228f0f303e98cf5fd28a2e433a60c50
5
5
  SHA512:
6
- metadata.gz: 35ab53ffeda373c7cbd67e9b44aa59176bda538d02be516e10d5d8aca2e36ebf96f56458c318689df792672cd06dcc3110057bcc8eb3fe2a1673705b13649679
7
- data.tar.gz: 85cf61a48776def558c3ac4ec34f59402faa00979552dc6e64bd46fdd0f0712955ce5e83761422f656174a5894a7eb622efb8fc1d3037afe46b365a3e41288c1
6
+ metadata.gz: a24dee1f1412596540a92e82b62919c4b7bb915ad8d88a6d0728ef0faf74b27f391a5c3227ee08727a24bb74dc57976e1662fd2b98de31ae2964b8bb234ae319
7
+ data.tar.gz: 6bf0353d16d627362941d7063d14279b09910e85a3fd86eec665fe059e1018ea0053afc042a1df9701840462d8a89fd01675fe40a811e517fd30746e240e9e91
@@ -1,608 +1,615 @@
1
- == 7.0.13 (2015-01-24)
2
-
3
- * Support optimistic lock and lock_version added to existing fixtures (Kirika)
4
- * README change to convey finding available versions (Aaron Bartell)
5
- * Fixes indentation in product_tariffs (Zaldabus)
6
-
7
- == 7.0.12 (2014-11-09)
8
-
9
- * ActiveRecord 4.1.7 support (Tom Hughes)
10
- * Extract CPK methods to its own module and extending instead of opening the singleton class
11
- which fixes Marshal#dump (Nicolás Hock Isaza)
12
-
13
- == 7.0.11 (2014-10-10)
14
-
15
- * ActiveRecord 4.1.6 support (Tom Hughes, Charlie Savage)
16
- * Verify MariaDB support and update docs (Isi Robayna)
17
- * Postgresql binary column support (Piotr Gębala)
18
- * Fix deleting of records from collection association (akeuk and Charlie Savage)
19
- * Fix invalid include (shiro16)
20
- * Improve tests (Yann Marquet)
21
-
22
- == 7.0.10 (2014-08-07)
23
-
24
- * Update attribute dirty methods to allow attribute *_was
25
- fields to be calculated correctly for enum fields (Zachary Salzbank)
26
- * Update read/write methods to match latest version of ActiveRecord (Charlie Savage)
27
-
28
- == 7.0.9 (2014-08-03)
29
-
30
- * Second attemp at fixing instantiation of has_many records via :includes that use composite keys - this
31
- time take into account no target records (Charlie Savage)
32
-
33
- == 7.0.8 (2014-08-03)
34
-
35
- * Fix instantiation of has_many records via :includes that use composite keys (Charlie Savage)
36
-
37
- == 7.0.7 (2014-07-29)
38
-
39
- * Add back support for calling find like this (Sammy Larbi):
40
-
41
- Membership.find('1,1')
42
-
43
- == 7.0.7 (2014-07-29)
44
-
45
- * Add back support for calling find like this (Sammy Larbi):
46
-
47
- Membership.find('1,1')
48
-
49
- == 7.0.6 (2014-07-22)
50
-
51
- * Change the way we override ActiveRecord::Persistence to call sequence of included modules such
52
- as callbacks (Charlie Savage)
53
-
54
- == 7.0.5 (2014-07-21)
55
-
56
- * Remove overriden Postgresql adapter code (Charlie Savage)
57
-
58
- == 7.0.4 (2014-07-09)
59
-
60
- * Fix overriding of Relation#where_values_hash (Pavel)
61
- * Add travis CI support (Pavel)
62
- * Run AR's original relation_for_destroy when primary key is not composite (Pavel)
63
-
64
- == 7.0.3 (2014-07-04)
65
-
66
- * Fixes for Rails 4.1.2+ compatibility (Tom Hughes)
67
- * Nested attribute fix (Sammy Larb)
68
- * Test fixes (Sammy Larb)
69
- * Fixes instantiating join records (Charlie Savage)
70
-
71
- == 7.0.2 (2014-06-01)
72
-
73
- * Fix id_was when one of the column names is called id (Adrian Hooper)
74
- * Fix queries that use ActiveRecord objects in the where clause (Adrian Hooper)
75
-
76
- == 7.0.1 (2014-05-27)
77
-
78
- * Fix setting of timestamps automatically by Rails (Charlie Savage)
79
-
80
- == 7.0.0 (2014-05-26)
81
-
82
- * Active Record 4.1 support! (Charlie Savage, Tom Hughes, Simon South)
83
-
84
- Note there is one big api change. Previously, CPK supported both of these calls:
85
-
86
- Membership.find(1,1)
87
- Membership.find([1,1])
88
-
89
- The first one no longer works. It was removed because it made the internal code simpler
90
- and makes the intention of the code clearer (especially when finding multiple records).
91
- If this change causes too much pain then please submit a ticket on Github.
92
-
93
- == 6.0.08 (2015-01-24)
94
-
95
- * Fix habtm association #delete_records (Uros Jurglic)
96
- * Support optimistic locking (Toshio Maki)
97
- * Remove singleton classes on CPK relations (Nicolás Hock Isaza)
98
-
99
- == 6.0.7 (2014-10-06)
100
-
101
- * Support Rails 4.0.6 (Tom Hughes)
102
-
103
- == 6.0.6 (2014-05-26)
104
-
105
- * Don't refer to deprecated set_primary_keys in README (Henare Degan)
106
- * Fix gemspec dependency (Charlie Savage)
107
-
108
- == 6.0.5 (2014-05-20)
109
-
110
- * Removed debugging output (Dan Draper)
111
- * Fixes to ensure that has_one associations work correctly (Dan Draper)
112
- * Fix postgres db migration failure since no result is returned in some cases (seashell-qd)
113
- * Fix exception raised in method "id=" (seashell.qd@hotmail.com)
114
-
115
- == 6.0.3 (2014-04-28)
116
-
117
- * Fixes setting of primary key when CPK is not used for a given model (see #191)
118
-
119
- == 6.0.2 (2014-04-28)
120
-
121
- * Fixes relating to ActiveRecord 4.0.x compatibility (Dan Draper)
122
- * Ensure that primary key is set on instance when creating new records (Dan Draper)
123
-
124
- == 6.0.1 (2013-11-29)
125
-
126
- * Handle records == :all in HasManyAssociation#delete_records. Without this calling
127
- delete or clear on a has_many assocation can result in an exception (Tom Hughes)
128
- * Don't include cpk key as an attributes - fixes json serialization - #168 (Charlie Savage)
129
- * Fix tests running on ruby 1.9.3 (Charlie Savage)
130
- * Update nested_attributes to work with activerecord 4.0.x (Nick DeLuca)
131
-
132
- == 6.0.0 (2013-08-04)
133
- * ActiveRecord 4.0 support (Sammy Larbi)
134
-
135
- == 5.0.13 2013-04-27
136
- * Batch query improvements (Jordan Byron)
137
- * Support nested attributes (aiasfina and Charlie Savage)
138
-
139
- == 5.0.12 2013-01-21
140
- * Fix HasManyAssociation foreign_key_present? method to work with non CPK assocations (Charlie Savage)
141
-
142
- == 5.0.11 2013-01-19
143
- * Patch HasManyAssociation foreign_key_present? method to work with array of keys (tbeauvais)
144
- * Patch reverse_sql_order method to break apart CPKs (tbeauvais)
145
- * Add test and fix for nested_attributes update (Dinshaw Gobhai)
146
- * Add test and fix for to_sym exception (Dinshaw Gobhai)
147
- * Add missing timestamp columns for mysql test_touch.rb (Dinshaw Gobhai)
148
-
149
- == 5.0.10 2012-11-21
150
- * ActiveRecord 3.2.9 compatability (Tom Hughes, Chris Heald, Jack Tang)
151
- * Add support for find_in_batches (Charlie Savage)
152
- * Add support for touch method (Macario Ortega)
153
- * Remove symbolized representation of primary keys to be consistent with ActiveRecord (Tiago Cardoso)
154
- * Update destroy method to use hash of primary keys over an array. This allows the proper SQL
155
- (using IS NULL) to be generated when one of the primary key attributes is nil (Scott Hunter).
156
-
157
- == 5.0.9 2012-09-29
158
- * Enable tests for MS SQL Servder (Enderson Maia)
159
- * Update ActiveRecord::Base#initialize_dup override in line with ActiveRecord::Base 3.2.5+ (Lucas Maxwell)
160
- * Require postgresql_adapter.rb also when using activerecord-postgis-adapter (Torsti Schulz)
161
- * Make cpk_in_predicate build a simple IN when possible (Tom Hughes)
162
- * Fixed problem loading jdbcpostgresql adapter (Troy Caldwell)
163
- * Add support for counter cache (Charlie Savage)
164
- * Fix recreating postgresql database (Charlie Savage)
165
- * Update dependency to ActiveRecord 3.2.8 or higher (Charlie Savage)
166
-
167
- == 5.0.8 2012-07-01
168
- * Enabled tests for MS SQL Server (Enderson Maia)
169
- * Update establish_connection to work with Rails 3.2.6 (Ivan Schneider)
170
- * Fix typos in rake tasks names in README_tests.rdoc (Ivan Schneider)
171
- * Fix problem with deleting non-CPK in Rails 3.2.5 (Sammy Larbi)
172
- * Fixes relationship deletion for HABTM in Rails when it passes :all flag instead of
173
- an array of IDs. Also adds new tests and test fixtures (Sammy Larbi)
174
- * Change mysql db creation to execute one statement each time, since in some setups
175
- it will not run multiple statements (Sammy Larbi)
176
- * Fix multiple assignments to same column due to duplicate keys in @changed_attributes.
177
- Includes test fixes (Jan Vlnas)
178
-
179
- == 5.0.7 2012-06-03
180
- * Fixed bug where validates_uniqueness failed for 3 or more primary keys. (Charlie Savage)
181
-
182
- == 5.0.6 2012-05-20
183
- * Fixed bug where setting a belongs_to association to nil would raise an error (Tyler Rick)
184
- * Remove special case code for 1 column selects and just choose to use Rails version of the
185
- method unless we need ours to deal with an Array (Sammy Larbi)
186
- * Change count tests to actually check for distinct, fix resulting error it
187
- demonstrated in the code (Sammy Larbi)
188
- * Specify mysql2 driver by default (Charlie Savage)
189
- * Update sqlite tests to run on Windows (Charlie Savage)
190
-
191
- == 5.0.5 2012-05-05
192
- * Count without slower subquery in cases where that is possible (Sammy Larbi)
193
- * When you call association.build for a has_many association that uses a
194
- composite foreign key, the newly built child record should have the values
195
- in its belongs_to foreign_key populated from its owner's values (Tyler Rick).
196
- * Removed test_has_many_with_primary_key method that wasn't being used because
197
- another method by the same name was defined below it (Tyler Rick).
198
- * Fixed a bug that was causing object.changes to raise TypeError (Tyler Rick)
199
- * Fix error when running rake mysql:rebuild_databases (Tyler Rick)
200
- * to_param should join with comma instead of minus sign (Tsutomu Kuroda)
201
- * Fix the "Factories" section of README.rdoc (Tsutomu Kuroda)
202
-
203
- == 5.0.4 2012-03-23
204
- * Update ActiveRecord::AttributeMethods#Write for Rails 3.2.2 (Travis Warlick)
205
-
206
- == 5.0.4 2012-03-23
207
- * Yanked
208
-
209
- == 5.0.2 2012-03-16
210
- * Use .rdoc extension on RDoc files (Elia Schito)
211
- * Update documentation to use self.primary_keys instead of set_primary_keys (Miguel Fonseca)
212
- * Added tests for comparing composite ids (Jim Jones)
213
- * Updating the README for clarity (Brett Fishman)
214
- * Fix method signature mismatch with active_record (Miguel Fonseca)
215
- * Fix ref in README (Elia Schito)
216
- * Add test for habm create (Charlie Savage)
217
-
218
- == 5.0.1 2012-02-13
219
- * Fix deprecation warning that was exactly backwards (Tom Hughes)
220
- * Fix primary_keys handling in models that inherit from other models
221
- but don't redefine their primary_key. Problem was the inherited
222
- models didn't correctly reference their parents primary_keys (Charlie Savage)
223
-
224
- == 5.0.0 2012-02-12
225
- * Fix tests so they pass on MySql (Charlie Savage)
226
- * Fix calculations to work with duplicate column names (cleesmith)
227
- * Switch rake tasks for Postgresql and MySql to use ActiveRecord API for
228
- creating and dropping databases (Charlie Savage)
229
- * Follow AR 3.2 lead and introduce self.primary_keys and deprecate set_primary_keys (Charlie Savage)
230
- * Switch from set_primary_key to self.primary_key= to avoid Rails deprecation (Charlie Savage)
231
- * Fix issue when using multiple database connections (David Doan)
232
- * Fix homepage in gemspec and remove email address (Charlie Savage)
233
- * Add support for string keys to exists? (Jan Vlnas)
234
- * Fix typo (Jason Karns)
235
-
236
- == 5.0.0.rc1 2012-01-16
237
- * ActiveRecord 3.2 support
238
-
239
- == 4.1.2 2012-01-12
240
- * Helper to allow the same tests to be used for both Oracle and other DBs
241
- by replacing quoted identifiers with all-caps equivalents on Oracle (Rhett Sutphin)
242
- * Update Oracle tests (Rhett Sutphin)
243
-
244
- == 4.1.1 2011-08-31
245
- * Support for AR 3.1.1
246
- * Make polymorphic belongs_to work in rails 3.1.1 (Tom Hughes)
247
- * Eliminate relative paths from the test suite (Rhett Sutphin)
248
- * Minor improvements to the CPK test runner w/o relative path changes (Rhett Sutphin)
249
- * Remove stray puts (Rhett Sutphin)
250
- * Allow AR logs to go to a file when running tests. This commit allows you to
251
- specify a file to use instead via the CPK_LOGFILE environment variable.
252
- STDOUT is still the default. (Rhett Sutphin)
253
- * Use ADAPTER env variable to select database to test. For example:
254
-
255
- ADAPTER=sqlite3 ruby test/test_suite.rb
256
- (Rhett Sutphin)
257
-
258
- * Eliminate constant redef warnings during test runs (Rhett Sutphin)
259
- * Add missing fixture declarations (Rhett Sutphin)
260
- * Standardize on integer PKs in polymorphic fixtures (Rhett Sutphin)
261
- * Fix tiny file name typos (Buck)
262
-
263
- == 4.0.0 2011-08-31
264
- * Support for AR 3.1
265
-
266
- == 4.0.0.beta9 2011-08-22
267
- * Fix eager-loading in AR 3.1.rc6.
268
-
269
- == 4.0.0.beta9 2011-082-22
270
- * Fix eager-loading in AR 3.1.rc6.
271
-
272
- == 4.0.0.beta8 2011-082-22
273
- * Sqlite 3 fixes (Jan Vlnas)
274
- * Fixes for to_key method (Jan Vlnas)
275
- * Compatible with Rails 3.1 RC6 (Ari Epstein, Travis Warlick)
276
-
277
- == 4.0.0.beta7 2011-07-26
278
- * Compatible with Rails 3.1 RC5 (TycoooN)
279
- * Do not use Arel::Nodes::Or to combine predicates because it creates a
280
- deeply nested stack that blows up.
281
-
282
- == 4.0.0.beta4 2011-07-22
283
- * Compatible with Rails 3.1 stable branch. No longer works with RC4 (Charlie Savage)
284
- * Do not require loading of postgresql gem unless needed (Charlie Savage)
285
-
286
- == 4.0.0.beta3 2011-07-08
287
- * Fix the ability to update the values of a primary key (Travis Warlick)
288
- * Support port and host configurations for postgres rake tasks (Travis Warlick)
289
-
290
- == 4.0.0.beta2 2011-06-21
291
- * ActiveRecord 3.1 RC4 compatibility.
292
- * Fix instantiation of CPK models with included associations
293
-
294
- == 4.0.0.beta1 2011-06-09
295
- * ActiveRecord 3.1 RC1 compatibility. This required a significant rewrite due to
296
- all the changes in AR 3.1 versus 3.0.
297
-
298
- == 3.1.11 2012-05-20
299
- Fix AssociationReflection#derive_primary_key for belongs_to relationships (Heinrich Lee Yu).
300
-
301
- == 3.1.10 2011-07-08
302
- * Bugfix for belongs_to with includes (John Ash)
303
- * Improved tests for calling clear on a habtm association, which involved (David Rueck)
304
- * Fixed bug that resulted in unrelated records being deleted when calling (David Rueck)
305
- * Output deprecation warnings about extra columns in join table CPK-aware (David Rueck)
306
-
307
-
308
- == 3.1.9 2011-06-04
309
- * Improve HABTM association tests (David Rueck)
310
- * Remove deprecated Rake tasks (Charlie Savage)
311
-
312
- == 3.1.8 2011-05-26
313
- * Fix calling clear on a HABTM associate (David Rueck)
314
-
315
- == 3.1.7 2011-05-26
316
- * Support regular AR models having one or many composite models (Jacques Fuentes)
317
- * Minor test cleanup (Charlie Savage)
318
- * Make version requirements more explicit (Charlie Savage)
319
- * Remove Arel extensions used for calculations (Charlie Savage)
320
- * Fix test that included wrong error constant
321
-
322
- == 3.1.6 2011-04-03
323
- * Updated belongs_to association to be a bit more flexible with non-CPK (Charlie Savage)
324
- base models (Jacques Fuentes)
325
- * Fix uniqueness check (David Rueck)
326
- * Fix write issue when one of they keys in a composite key is
327
- called id (Tom Hughes)
328
-
329
-
330
- == 3.1.5 2011-03-24
331
- * Fix simple calculation methods (Charlie Savage)
332
- * Fix instantiation of cpk records via associations (Charlie Savage)
333
- * Fix Relation#delete (Charlie Savage)
334
- * Fix Relation#destroy (Charlie Savage)
335
-
336
-
337
- == 3.1.4 2011-03-06
338
- * Support ActiveRecord 3.0.5 - interpolate_sql was removed and
339
- replaced by interpolate_and_sanitize_sql (Charlie Savage)
340
- * Fix persistence methods to support destroy callbacks (Charlie Savage)
341
- * Support rake 0.9.0 beta (Charlie Savage)
342
-
343
-
344
- == 3.1.2 2011-02-26
345
- * Add back in support for find('3,3') which makes it possible to
346
- do find(params[id]). This implementation is simpler than earlier version
347
- improving code readability.
348
- * Support for finding multiple records either via find([1,2], [3,4])
349
- * Remove to_composite_ids method which is no longer needed
350
-
351
-
352
- == 3.1.1 2011-02-07
353
- * Implement id_before_type_cast (Jason Lewis)
354
- * Add in tests for Model.includes(:other_model)
355
- * Fix object comparison with nil in composite primary keys (StackNG)
356
- * Make it easier to run tests with different database adapters (Toby Cabot)
357
- * Fix AssociationReflection#primary_key_name for polymorphic relationships (Dave Doan)
358
-
359
-
360
- == 3.1.0 2010-12-17
361
- * Add back in rake test tasks (Toby Cabot)
362
- * Add support for multiple string composite keys (wouter)
363
- * Remove support for find('3,3'). Instead use find([3,3])
364
-
365
-
366
- == 3.0.9 2010-12-04
367
- * Fix up support for composite key fixtures.
368
-
369
-
370
- == 3.0.8 2010-12-04
371
- * Fix for translation issue in unique validation. Thanks to Daniel Berger for the patch.
372
- * Fix to support child classes of composite primary key models
373
-
374
-
375
- == 3.0.7 2010-11-29
376
- * Fix has and belongs to many associations implementation.
377
-
378
-
379
- == 3.0.6 2010-11-29 (yanked)
380
- * Add full support for has and belongs to many associations.
381
-
382
-
383
- == 3.0.5 2010-11-28 (yanked)
384
- * Apply patch from Marian Rudzynski for fixing up attribute_methods/primary_key
385
- * Apply patch from Toby Cabot to fix up various sqlite3 issues
386
- * Add partial support for has and belongs to many associations. Currently a cpk model
387
- can have a habtm, but a normal model cannot have a habtm to a cpk model (its actually
388
- not too hard to add, but one step at a time...)
389
-
390
-
391
- == 3.0.4 2010-11-21
392
- * Support deleting records when dependent is set to :delete_all
393
- * Switch the method #id to return a CompositeKeys instance (thus going back to how
394
- this was done in previous CPK versions)
395
-
396
-
397
- == 3.0.3 2010-11-19
398
- * Support ActiveRecord 3.0.3 and Arel 2+
399
- * Require ActiveRecord 3.0.3 as minimum dependency
400
- * Fix double quoting issue with table names - thanks to Kevin Motschiedler for a patch.
401
- * Fix SQLiteAdapter class inheritance issue - thanks to Brandon Hauff for a patch.
402
-
403
-
404
- == 3.0.1.b3 2010-11-07
405
-
406
- * Fix bug in joining to :has_one association
407
- * Added support for Model.find(:last)
408
- * Added support for finding via associations with
409
- limited ids. For example find(:include => :foo, :limit => 1)
410
-
411
- == 3.0.1.b2 2010-11-06
412
-
413
- * Port to Rails 3.0 and Ruby 1.9.2
414
-
415
- * Backwards compatability issues
416
- + You can no longer define a composite primary key with a single field. If you
417
- try, your model will just default to a standard active record model. Removing
418
- this corner case simplified the code.
419
- + Removed CompositePrimaryKeys::CompositeKeys. This was done so that the #to_s
420
- method on composite ids, such as [1,2], returns "[1, 2]". This in turns
421
- reduces the amount of core Rails code that needs to be overridden.
422
- + Setting attribute values by string is no longer supported. For example, this
423
- no longer works:
424
- my_record[[:main_id, :secondary_id]] = '1,2'
425
- Instead, do this:
426
- my_record[[:main_id, :secondary_id]] = [1,2]
427
- Once again, this was done to reduce the amount of overridden Rails code
428
- + At the moment, complex finds with nested arrays do not work. For example
429
- find([[1,2], [3,4]))
430
- + Count methods no longer work. For example, Tariff.count(:include => :product_tariffs)
431
- in the TestAssociations#test_count test returns an error. This is because Rails 3.0
432
- uses Arel to perform such calculations, and its not obvious (at least to me) how to
433
- hook into this new mechanism to support tables with composite keys.
434
- + The TestPolymorphic#test_polymorphic_has_many_through is currently failing, but this
435
- looks like an ActiveRecord 3.0 bug to me.
436
-
437
- == 2.3.5.1 2010-02-13
438
-
439
- * Resolved "warning: already initialized constant HasManyThroughCantAssociateThroughHasManyReflection" [Titi Ala'ilima]
440
-
441
- == 2.3.5 2009-12-16
442
-
443
- * Fixed several bugs in has_one and has_many associations when :primary_key specified [kpumuk]
444
-
445
- == 2.3.2 2009-07-16
446
-
447
- * explicitly load associations.rb due to some getting an unitialized constant error
448
-
449
- == 2.3.2 2009-05-28
450
-
451
- * get tests working again with AR 2.3.2
452
-
453
- == 2.2.1 2009-01-21
454
-
455
- * fix ActiveRecord#exists? to work when passing conditions instead of ids
456
-
457
- == 2.2.0 2008-10-29
458
-
459
- * Rails 2.2.0 compatibility
460
-
461
- == 1.1.0 2008-10-29
462
-
463
- * fixes to get cpk working for Rails 2.1.2
464
-
465
- == 1.0.10 2008-10-22
466
-
467
- * add composite key where clause creator method [timurv]
468
-
469
- == 1.0.9 2008-09-08
470
-
471
- * fix postgres tests
472
- * fix for delete_records when has_many association has composite keys [darxriggs]
473
- * more consistent table/column name quoting [pbrant]
474
-
475
- == 1.0.8 2008-08-27
476
-
477
- * fix has_many :through for non composite models [thx rcarver]
478
-
479
- == 1.0.7 2008-08-12
480
-
481
- * fix for the last fix -- when has_many is composite and belongs_to is single
482
-
483
- == 1.0.6 2008-08-06
484
-
485
- * fix associations create
486
-
487
- == 1.0.5 2008-07-25
488
-
489
- * fix for calculations with a group by clause [thx Sirius Black]
490
-
491
- == 1.0.4 2008-07-15
492
-
493
- * support for oracle_enhanced adapter [thx Raimonds Simanovskis]
494
-
495
- == 1.0.3 2008-07-13
496
-
497
- * more fixes and tests for has many through [thx Menno van der Sman]
498
-
499
- == 1.0.2 2008-06-07
500
-
501
- * fix for has many through when through association has composite keys
502
-
503
- == 1.0.1 2008-06-06
504
-
505
- * Oracle fixes
506
-
507
- == 1.0.0 2008-06-05
508
-
509
- * Support for Rails 2.1
510
-
511
- == 0.9.93 2008-06-01
512
-
513
- * set fixed dependency on activerecord 2.0.2
514
-
515
- == 0.9.92 2008-02-22
516
-
517
- * Support for has_and_belongs_to_many
518
-
519
- == 0.9.91 2008-01-27
520
-
521
- * Incremented activerecord dependency to 2.0.2 [thx emmanuel.pirsch]
522
-
523
- == 0.9.90 2008-01-27
524
-
525
- * Trial release for rails/activerecord 2.0.2 supported
526
-
527
- == 0.9.1 2007-10-28
528
-
529
- * Migrations fix - allow :primary_key => [:name] to work [no unit test] [thx Shugo Maeda]
530
-
531
- == 0.9.0 2007-09-28
532
-
533
- * Added support for polymorphs [thx nerdrew]
534
- * init.rb file so gem can be installed as a plugin for Rails [thx nerdrew]
535
- * Added ibm_db support [thx K Venkatasubramaniyan]
536
- * Support for cleaning dependents [thx K Venkatasubramaniyan]
537
- * Rafactored db rake tasks into namespaces
538
- * Added namespaced tests (e.g. mysql:test for test_mysql)
539
-
540
- == 0.8.6 / 2007-6-12
541
-
542
- * 1 emergency fix due to Rails Core change
543
- * Rails v7004 removed #quote; fixed with connection.quote_column_name [thx nerdrew]
544
-
545
- == 0.8.5 / 2007-6-5
546
-
547
- * 1 change due to Rails Core change
548
- * Can no longer use RAILS_CONNECTION_ADAPTERS from Rails core
549
- * 7 dev improvement:
550
- * Changed History.txt syntax to rdoc format
551
- * Added deploy tasks
552
- * Removed CHANGELOG + migrated into History.txt
553
- * Changed PKG_NAME -> GEM_NAME in Rakefile
554
- * Renamed README -> README.txt for :publish_docs task
555
- * Added :check_version task
556
- * VER => VERS in rakefile
557
- * 1 website improvement:
558
- * website/index.txt includes link to "8 steps to fix other ppls code"
559
-
560
- == 0.8.4 / 2007-5-3
561
-
562
- * 1 bugfix
563
- * Corrected ids_list => ids in the exception message. That'll teach me for not adding unit tests before fixing bugs.
564
-
565
- == 0.8.3 / 2007-5-3
566
-
567
- * 1 bugfix
568
- * Explicit reference to ::ActiveRecord::RecordNotFound
569
- * 1 website addition:
570
- * Added routing help [Pete Sumskas]
571
-
572
- == 0.8.2 / 2007-4-11
573
-
574
- * 1 major enhancement:
575
- * Oracle unit tests!! [Darrin Holst]
576
- * And they work too
577
-
578
- == 0.8.1 / 2007-4-10
579
-
580
- * 1 bug fix:
581
- * Fixed the distinct(count) for oracle (removed 'as')
582
-
583
- == 0.8.0 / 2007-4-6
584
-
585
- * 1 major enhancement:
586
- * Support for calcualtions on associations
587
- * 2 new DB supported:
588
- * Tests run on sqlite
589
- * Tests run on postgresql
590
- * History.txt to keep track of changes like these
591
- * Using Hoe for Rakefile
592
- * Website generator rake tasks
593
-
594
- == 0.3.3
595
- * id=
596
- * create now work
597
-
598
- == 0.1.4
599
- * it was important that #{primary_key} for composites --> 'key1,key2' and not 'key1key2' so created PrimaryKeys class
600
-
601
- == 0.0.1
602
- * Initial version
603
- * set_primary_keys(*keys) is the activation class method to transform an ActiveRecord into a composite primary key AR
604
- * find(*ids) supports the passing of
605
- * id sets: Foo.find(2,1),
606
- * lists of id sets: Foo.find([2,1], [7,3], [8,12]),
607
- * and even stringified versions of the above:
608
- * Foo.find '2,1' or Foo.find '2,1;7,3'
1
+ == 7.0.14 (2015-08-04)
2
+
3
+ * Remove overriden Base#==(comparison_object) which had a different behavior than stock AR method
4
+ for non-peristed objects (Charlie Savage)
5
+ * Update support for Uniquenes validations (Avi Leavitt)
6
+ * Remove call to verify_active_connections! which was removed from AR 4.1 (Steve Pletcher)
7
+
8
+ == 7.0.13 (2015-01-24)
9
+
10
+ * Support optimistic lock and lock_version added to existing fixtures (Kirika)
11
+ * README change to convey finding available versions (Aaron Bartell)
12
+ * Fixes indentation in product_tariffs (Zaldabus)
13
+
14
+ == 7.0.12 (2014-11-09)
15
+
16
+ * ActiveRecord 4.1.7 support (Tom Hughes)
17
+ * Extract CPK methods to its own module and extending instead of opening the singleton class
18
+ which fixes Marshal#dump (Nicolás Hock Isaza)
19
+
20
+ == 7.0.11 (2014-10-10)
21
+
22
+ * ActiveRecord 4.1.6 support (Tom Hughes, Charlie Savage)
23
+ * Verify MariaDB support and update docs (Isi Robayna)
24
+ * Postgresql binary column support (Piotr Gębala)
25
+ * Fix deleting of records from collection association (akeuk and Charlie Savage)
26
+ * Fix invalid include (shiro16)
27
+ * Improve tests (Yann Marquet)
28
+
29
+ == 7.0.10 (2014-08-07)
30
+
31
+ * Update attribute dirty methods to allow attribute *_was
32
+ fields to be calculated correctly for enum fields (Zachary Salzbank)
33
+ * Update read/write methods to match latest version of ActiveRecord (Charlie Savage)
34
+
35
+ == 7.0.9 (2014-08-03)
36
+
37
+ * Second attemp at fixing instantiation of has_many records via :includes that use composite keys - this
38
+ time take into account no target records (Charlie Savage)
39
+
40
+ == 7.0.8 (2014-08-03)
41
+
42
+ * Fix instantiation of has_many records via :includes that use composite keys (Charlie Savage)
43
+
44
+ == 7.0.7 (2014-07-29)
45
+
46
+ * Add back support for calling find like this (Sammy Larbi):
47
+
48
+ Membership.find('1,1')
49
+
50
+ == 7.0.7 (2014-07-29)
51
+
52
+ * Add back support for calling find like this (Sammy Larbi):
53
+
54
+ Membership.find('1,1')
55
+
56
+ == 7.0.6 (2014-07-22)
57
+
58
+ * Change the way we override ActiveRecord::Persistence to call sequence of included modules such
59
+ as callbacks (Charlie Savage)
60
+
61
+ == 7.0.5 (2014-07-21)
62
+
63
+ * Remove overriden Postgresql adapter code (Charlie Savage)
64
+
65
+ == 7.0.4 (2014-07-09)
66
+
67
+ * Fix overriding of Relation#where_values_hash (Pavel)
68
+ * Add travis CI support (Pavel)
69
+ * Run AR's original relation_for_destroy when primary key is not composite (Pavel)
70
+
71
+ == 7.0.3 (2014-07-04)
72
+
73
+ * Fixes for Rails 4.1.2+ compatibility (Tom Hughes)
74
+ * Nested attribute fix (Sammy Larb)
75
+ * Test fixes (Sammy Larb)
76
+ * Fixes instantiating join records (Charlie Savage)
77
+
78
+ == 7.0.2 (2014-06-01)
79
+
80
+ * Fix id_was when one of the column names is called id (Adrian Hooper)
81
+ * Fix queries that use ActiveRecord objects in the where clause (Adrian Hooper)
82
+
83
+ == 7.0.1 (2014-05-27)
84
+
85
+ * Fix setting of timestamps automatically by Rails (Charlie Savage)
86
+
87
+ == 7.0.0 (2014-05-26)
88
+
89
+ * Active Record 4.1 support! (Charlie Savage, Tom Hughes, Simon South)
90
+
91
+ Note there is one big api change. Previously, CPK supported both of these calls:
92
+
93
+ Membership.find(1,1)
94
+ Membership.find([1,1])
95
+
96
+ The first one no longer works. It was removed because it made the internal code simpler
97
+ and makes the intention of the code clearer (especially when finding multiple records).
98
+ If this change causes too much pain then please submit a ticket on Github.
99
+
100
+ == 6.0.08 (2015-01-24)
101
+
102
+ * Fix habtm association #delete_records (Uros Jurglic)
103
+ * Support optimistic locking (Toshio Maki)
104
+ * Remove singleton classes on CPK relations (Nicolás Hock Isaza)
105
+
106
+ == 6.0.7 (2014-10-06)
107
+
108
+ * Support Rails 4.0.6 (Tom Hughes)
109
+
110
+ == 6.0.6 (2014-05-26)
111
+
112
+ * Don't refer to deprecated set_primary_keys in README (Henare Degan)
113
+ * Fix gemspec dependency (Charlie Savage)
114
+
115
+ == 6.0.5 (2014-05-20)
116
+
117
+ * Removed debugging output (Dan Draper)
118
+ * Fixes to ensure that has_one associations work correctly (Dan Draper)
119
+ * Fix postgres db migration failure since no result is returned in some cases (seashell-qd)
120
+ * Fix exception raised in method "id=" (seashell.qd@hotmail.com)
121
+
122
+ == 6.0.3 (2014-04-28)
123
+
124
+ * Fixes setting of primary key when CPK is not used for a given model (see #191)
125
+
126
+ == 6.0.2 (2014-04-28)
127
+
128
+ * Fixes relating to ActiveRecord 4.0.x compatibility (Dan Draper)
129
+ * Ensure that primary key is set on instance when creating new records (Dan Draper)
130
+
131
+ == 6.0.1 (2013-11-29)
132
+
133
+ * Handle records == :all in HasManyAssociation#delete_records. Without this calling
134
+ delete or clear on a has_many assocation can result in an exception (Tom Hughes)
135
+ * Don't include cpk key as an attributes - fixes json serialization - #168 (Charlie Savage)
136
+ * Fix tests running on ruby 1.9.3 (Charlie Savage)
137
+ * Update nested_attributes to work with activerecord 4.0.x (Nick DeLuca)
138
+
139
+ == 6.0.0 (2013-08-04)
140
+ * ActiveRecord 4.0 support (Sammy Larbi)
141
+
142
+ == 5.0.13 2013-04-27
143
+ * Batch query improvements (Jordan Byron)
144
+ * Support nested attributes (aiasfina and Charlie Savage)
145
+
146
+ == 5.0.12 2013-01-21
147
+ * Fix HasManyAssociation foreign_key_present? method to work with non CPK assocations (Charlie Savage)
148
+
149
+ == 5.0.11 2013-01-19
150
+ * Patch HasManyAssociation foreign_key_present? method to work with array of keys (tbeauvais)
151
+ * Patch reverse_sql_order method to break apart CPKs (tbeauvais)
152
+ * Add test and fix for nested_attributes update (Dinshaw Gobhai)
153
+ * Add test and fix for to_sym exception (Dinshaw Gobhai)
154
+ * Add missing timestamp columns for mysql test_touch.rb (Dinshaw Gobhai)
155
+
156
+ == 5.0.10 2012-11-21
157
+ * ActiveRecord 3.2.9 compatability (Tom Hughes, Chris Heald, Jack Tang)
158
+ * Add support for find_in_batches (Charlie Savage)
159
+ * Add support for touch method (Macario Ortega)
160
+ * Remove symbolized representation of primary keys to be consistent with ActiveRecord (Tiago Cardoso)
161
+ * Update destroy method to use hash of primary keys over an array. This allows the proper SQL
162
+ (using IS NULL) to be generated when one of the primary key attributes is nil (Scott Hunter).
163
+
164
+ == 5.0.9 2012-09-29
165
+ * Enable tests for MS SQL Servder (Enderson Maia)
166
+ * Update ActiveRecord::Base#initialize_dup override in line with ActiveRecord::Base 3.2.5+ (Lucas Maxwell)
167
+ * Require postgresql_adapter.rb also when using activerecord-postgis-adapter (Torsti Schulz)
168
+ * Make cpk_in_predicate build a simple IN when possible (Tom Hughes)
169
+ * Fixed problem loading jdbcpostgresql adapter (Troy Caldwell)
170
+ * Add support for counter cache (Charlie Savage)
171
+ * Fix recreating postgresql database (Charlie Savage)
172
+ * Update dependency to ActiveRecord 3.2.8 or higher (Charlie Savage)
173
+
174
+ == 5.0.8 2012-07-01
175
+ * Enabled tests for MS SQL Server (Enderson Maia)
176
+ * Update establish_connection to work with Rails 3.2.6 (Ivan Schneider)
177
+ * Fix typos in rake tasks names in README_tests.rdoc (Ivan Schneider)
178
+ * Fix problem with deleting non-CPK in Rails 3.2.5 (Sammy Larbi)
179
+ * Fixes relationship deletion for HABTM in Rails when it passes :all flag instead of
180
+ an array of IDs. Also adds new tests and test fixtures (Sammy Larbi)
181
+ * Change mysql db creation to execute one statement each time, since in some setups
182
+ it will not run multiple statements (Sammy Larbi)
183
+ * Fix multiple assignments to same column due to duplicate keys in @changed_attributes.
184
+ Includes test fixes (Jan Vlnas)
185
+
186
+ == 5.0.7 2012-06-03
187
+ * Fixed bug where validates_uniqueness failed for 3 or more primary keys. (Charlie Savage)
188
+
189
+ == 5.0.6 2012-05-20
190
+ * Fixed bug where setting a belongs_to association to nil would raise an error (Tyler Rick)
191
+ * Remove special case code for 1 column selects and just choose to use Rails version of the
192
+ method unless we need ours to deal with an Array (Sammy Larbi)
193
+ * Change count tests to actually check for distinct, fix resulting error it
194
+ demonstrated in the code (Sammy Larbi)
195
+ * Specify mysql2 driver by default (Charlie Savage)
196
+ * Update sqlite tests to run on Windows (Charlie Savage)
197
+
198
+ == 5.0.5 2012-05-05
199
+ * Count without slower subquery in cases where that is possible (Sammy Larbi)
200
+ * When you call association.build for a has_many association that uses a
201
+ composite foreign key, the newly built child record should have the values
202
+ in its belongs_to foreign_key populated from its owner's values (Tyler Rick).
203
+ * Removed test_has_many_with_primary_key method that wasn't being used because
204
+ another method by the same name was defined below it (Tyler Rick).
205
+ * Fixed a bug that was causing object.changes to raise TypeError (Tyler Rick)
206
+ * Fix error when running rake mysql:rebuild_databases (Tyler Rick)
207
+ * to_param should join with comma instead of minus sign (Tsutomu Kuroda)
208
+ * Fix the "Factories" section of README.rdoc (Tsutomu Kuroda)
209
+
210
+ == 5.0.4 2012-03-23
211
+ * Update ActiveRecord::AttributeMethods#Write for Rails 3.2.2 (Travis Warlick)
212
+
213
+ == 5.0.4 2012-03-23
214
+ * Yanked
215
+
216
+ == 5.0.2 2012-03-16
217
+ * Use .rdoc extension on RDoc files (Elia Schito)
218
+ * Update documentation to use self.primary_keys instead of set_primary_keys (Miguel Fonseca)
219
+ * Added tests for comparing composite ids (Jim Jones)
220
+ * Updating the README for clarity (Brett Fishman)
221
+ * Fix method signature mismatch with active_record (Miguel Fonseca)
222
+ * Fix ref in README (Elia Schito)
223
+ * Add test for habm create (Charlie Savage)
224
+
225
+ == 5.0.1 2012-02-13
226
+ * Fix deprecation warning that was exactly backwards (Tom Hughes)
227
+ * Fix primary_keys handling in models that inherit from other models
228
+ but don't redefine their primary_key. Problem was the inherited
229
+ models didn't correctly reference their parents primary_keys (Charlie Savage)
230
+
231
+ == 5.0.0 2012-02-12
232
+ * Fix tests so they pass on MySql (Charlie Savage)
233
+ * Fix calculations to work with duplicate column names (cleesmith)
234
+ * Switch rake tasks for Postgresql and MySql to use ActiveRecord API for
235
+ creating and dropping databases (Charlie Savage)
236
+ * Follow AR 3.2 lead and introduce self.primary_keys and deprecate set_primary_keys (Charlie Savage)
237
+ * Switch from set_primary_key to self.primary_key= to avoid Rails deprecation (Charlie Savage)
238
+ * Fix issue when using multiple database connections (David Doan)
239
+ * Fix homepage in gemspec and remove email address (Charlie Savage)
240
+ * Add support for string keys to exists? (Jan Vlnas)
241
+ * Fix typo (Jason Karns)
242
+
243
+ == 5.0.0.rc1 2012-01-16
244
+ * ActiveRecord 3.2 support
245
+
246
+ == 4.1.2 2012-01-12
247
+ * Helper to allow the same tests to be used for both Oracle and other DBs
248
+ by replacing quoted identifiers with all-caps equivalents on Oracle (Rhett Sutphin)
249
+ * Update Oracle tests (Rhett Sutphin)
250
+
251
+ == 4.1.1 2011-08-31
252
+ * Support for AR 3.1.1
253
+ * Make polymorphic belongs_to work in rails 3.1.1 (Tom Hughes)
254
+ * Eliminate relative paths from the test suite (Rhett Sutphin)
255
+ * Minor improvements to the CPK test runner w/o relative path changes (Rhett Sutphin)
256
+ * Remove stray puts (Rhett Sutphin)
257
+ * Allow AR logs to go to a file when running tests. This commit allows you to
258
+ specify a file to use instead via the CPK_LOGFILE environment variable.
259
+ STDOUT is still the default. (Rhett Sutphin)
260
+ * Use ADAPTER env variable to select database to test. For example:
261
+
262
+ ADAPTER=sqlite3 ruby test/test_suite.rb
263
+ (Rhett Sutphin)
264
+
265
+ * Eliminate constant redef warnings during test runs (Rhett Sutphin)
266
+ * Add missing fixture declarations (Rhett Sutphin)
267
+ * Standardize on integer PKs in polymorphic fixtures (Rhett Sutphin)
268
+ * Fix tiny file name typos (Buck)
269
+
270
+ == 4.0.0 2011-08-31
271
+ * Support for AR 3.1
272
+
273
+ == 4.0.0.beta9 2011-08-22
274
+ * Fix eager-loading in AR 3.1.rc6.
275
+
276
+ == 4.0.0.beta9 2011-082-22
277
+ * Fix eager-loading in AR 3.1.rc6.
278
+
279
+ == 4.0.0.beta8 2011-082-22
280
+ * Sqlite 3 fixes (Jan Vlnas)
281
+ * Fixes for to_key method (Jan Vlnas)
282
+ * Compatible with Rails 3.1 RC6 (Ari Epstein, Travis Warlick)
283
+
284
+ == 4.0.0.beta7 2011-07-26
285
+ * Compatible with Rails 3.1 RC5 (TycoooN)
286
+ * Do not use Arel::Nodes::Or to combine predicates because it creates a
287
+ deeply nested stack that blows up.
288
+
289
+ == 4.0.0.beta4 2011-07-22
290
+ * Compatible with Rails 3.1 stable branch. No longer works with RC4 (Charlie Savage)
291
+ * Do not require loading of postgresql gem unless needed (Charlie Savage)
292
+
293
+ == 4.0.0.beta3 2011-07-08
294
+ * Fix the ability to update the values of a primary key (Travis Warlick)
295
+ * Support port and host configurations for postgres rake tasks (Travis Warlick)
296
+
297
+ == 4.0.0.beta2 2011-06-21
298
+ * ActiveRecord 3.1 RC4 compatibility.
299
+ * Fix instantiation of CPK models with included associations
300
+
301
+ == 4.0.0.beta1 2011-06-09
302
+ * ActiveRecord 3.1 RC1 compatibility. This required a significant rewrite due to
303
+ all the changes in AR 3.1 versus 3.0.
304
+
305
+ == 3.1.11 2012-05-20
306
+ Fix AssociationReflection#derive_primary_key for belongs_to relationships (Heinrich Lee Yu).
307
+
308
+ == 3.1.10 2011-07-08
309
+ * Bugfix for belongs_to with includes (John Ash)
310
+ * Improved tests for calling clear on a habtm association, which involved (David Rueck)
311
+ * Fixed bug that resulted in unrelated records being deleted when calling (David Rueck)
312
+ * Output deprecation warnings about extra columns in join table CPK-aware (David Rueck)
313
+
314
+
315
+ == 3.1.9 2011-06-04
316
+ * Improve HABTM association tests (David Rueck)
317
+ * Remove deprecated Rake tasks (Charlie Savage)
318
+
319
+ == 3.1.8 2011-05-26
320
+ * Fix calling clear on a HABTM associate (David Rueck)
321
+
322
+ == 3.1.7 2011-05-26
323
+ * Support regular AR models having one or many composite models (Jacques Fuentes)
324
+ * Minor test cleanup (Charlie Savage)
325
+ * Make version requirements more explicit (Charlie Savage)
326
+ * Remove Arel extensions used for calculations (Charlie Savage)
327
+ * Fix test that included wrong error constant
328
+
329
+ == 3.1.6 2011-04-03
330
+ * Updated belongs_to association to be a bit more flexible with non-CPK (Charlie Savage)
331
+ base models (Jacques Fuentes)
332
+ * Fix uniqueness check (David Rueck)
333
+ * Fix write issue when one of they keys in a composite key is
334
+ called id (Tom Hughes)
335
+
336
+
337
+ == 3.1.5 2011-03-24
338
+ * Fix simple calculation methods (Charlie Savage)
339
+ * Fix instantiation of cpk records via associations (Charlie Savage)
340
+ * Fix Relation#delete (Charlie Savage)
341
+ * Fix Relation#destroy (Charlie Savage)
342
+
343
+
344
+ == 3.1.4 2011-03-06
345
+ * Support ActiveRecord 3.0.5 - interpolate_sql was removed and
346
+ replaced by interpolate_and_sanitize_sql (Charlie Savage)
347
+ * Fix persistence methods to support destroy callbacks (Charlie Savage)
348
+ * Support rake 0.9.0 beta (Charlie Savage)
349
+
350
+
351
+ == 3.1.2 2011-02-26
352
+ * Add back in support for find('3,3') which makes it possible to
353
+ do find(params[id]). This implementation is simpler than earlier version
354
+ improving code readability.
355
+ * Support for finding multiple records either via find([1,2], [3,4])
356
+ * Remove to_composite_ids method which is no longer needed
357
+
358
+
359
+ == 3.1.1 2011-02-07
360
+ * Implement id_before_type_cast (Jason Lewis)
361
+ * Add in tests for Model.includes(:other_model)
362
+ * Fix object comparison with nil in composite primary keys (StackNG)
363
+ * Make it easier to run tests with different database adapters (Toby Cabot)
364
+ * Fix AssociationReflection#primary_key_name for polymorphic relationships (Dave Doan)
365
+
366
+
367
+ == 3.1.0 2010-12-17
368
+ * Add back in rake test tasks (Toby Cabot)
369
+ * Add support for multiple string composite keys (wouter)
370
+ * Remove support for find('3,3'). Instead use find([3,3])
371
+
372
+
373
+ == 3.0.9 2010-12-04
374
+ * Fix up support for composite key fixtures.
375
+
376
+
377
+ == 3.0.8 2010-12-04
378
+ * Fix for translation issue in unique validation. Thanks to Daniel Berger for the patch.
379
+ * Fix to support child classes of composite primary key models
380
+
381
+
382
+ == 3.0.7 2010-11-29
383
+ * Fix has and belongs to many associations implementation.
384
+
385
+
386
+ == 3.0.6 2010-11-29 (yanked)
387
+ * Add full support for has and belongs to many associations.
388
+
389
+
390
+ == 3.0.5 2010-11-28 (yanked)
391
+ * Apply patch from Marian Rudzynski for fixing up attribute_methods/primary_key
392
+ * Apply patch from Toby Cabot to fix up various sqlite3 issues
393
+ * Add partial support for has and belongs to many associations. Currently a cpk model
394
+ can have a habtm, but a normal model cannot have a habtm to a cpk model (its actually
395
+ not too hard to add, but one step at a time...)
396
+
397
+
398
+ == 3.0.4 2010-11-21
399
+ * Support deleting records when dependent is set to :delete_all
400
+ * Switch the method #id to return a CompositeKeys instance (thus going back to how
401
+ this was done in previous CPK versions)
402
+
403
+
404
+ == 3.0.3 2010-11-19
405
+ * Support ActiveRecord 3.0.3 and Arel 2+
406
+ * Require ActiveRecord 3.0.3 as minimum dependency
407
+ * Fix double quoting issue with table names - thanks to Kevin Motschiedler for a patch.
408
+ * Fix SQLiteAdapter class inheritance issue - thanks to Brandon Hauff for a patch.
409
+
410
+
411
+ == 3.0.1.b3 2010-11-07
412
+
413
+ * Fix bug in joining to :has_one association
414
+ * Added support for Model.find(:last)
415
+ * Added support for finding via associations with
416
+ limited ids. For example find(:include => :foo, :limit => 1)
417
+
418
+ == 3.0.1.b2 2010-11-06
419
+
420
+ * Port to Rails 3.0 and Ruby 1.9.2
421
+
422
+ * Backwards compatability issues
423
+ + You can no longer define a composite primary key with a single field. If you
424
+ try, your model will just default to a standard active record model. Removing
425
+ this corner case simplified the code.
426
+ + Removed CompositePrimaryKeys::CompositeKeys. This was done so that the #to_s
427
+ method on composite ids, such as [1,2], returns "[1, 2]". This in turns
428
+ reduces the amount of core Rails code that needs to be overridden.
429
+ + Setting attribute values by string is no longer supported. For example, this
430
+ no longer works:
431
+ my_record[[:main_id, :secondary_id]] = '1,2'
432
+ Instead, do this:
433
+ my_record[[:main_id, :secondary_id]] = [1,2]
434
+ Once again, this was done to reduce the amount of overridden Rails code
435
+ + At the moment, complex finds with nested arrays do not work. For example
436
+ find([[1,2], [3,4]))
437
+ + Count methods no longer work. For example, Tariff.count(:include => :product_tariffs)
438
+ in the TestAssociations#test_count test returns an error. This is because Rails 3.0
439
+ uses Arel to perform such calculations, and its not obvious (at least to me) how to
440
+ hook into this new mechanism to support tables with composite keys.
441
+ + The TestPolymorphic#test_polymorphic_has_many_through is currently failing, but this
442
+ looks like an ActiveRecord 3.0 bug to me.
443
+
444
+ == 2.3.5.1 2010-02-13
445
+
446
+ * Resolved "warning: already initialized constant HasManyThroughCantAssociateThroughHasManyReflection" [Titi Ala'ilima]
447
+
448
+ == 2.3.5 2009-12-16
449
+
450
+ * Fixed several bugs in has_one and has_many associations when :primary_key specified [kpumuk]
451
+
452
+ == 2.3.2 2009-07-16
453
+
454
+ * explicitly load associations.rb due to some getting an unitialized constant error
455
+
456
+ == 2.3.2 2009-05-28
457
+
458
+ * get tests working again with AR 2.3.2
459
+
460
+ == 2.2.1 2009-01-21
461
+
462
+ * fix ActiveRecord#exists? to work when passing conditions instead of ids
463
+
464
+ == 2.2.0 2008-10-29
465
+
466
+ * Rails 2.2.0 compatibility
467
+
468
+ == 1.1.0 2008-10-29
469
+
470
+ * fixes to get cpk working for Rails 2.1.2
471
+
472
+ == 1.0.10 2008-10-22
473
+
474
+ * add composite key where clause creator method [timurv]
475
+
476
+ == 1.0.9 2008-09-08
477
+
478
+ * fix postgres tests
479
+ * fix for delete_records when has_many association has composite keys [darxriggs]
480
+ * more consistent table/column name quoting [pbrant]
481
+
482
+ == 1.0.8 2008-08-27
483
+
484
+ * fix has_many :through for non composite models [thx rcarver]
485
+
486
+ == 1.0.7 2008-08-12
487
+
488
+ * fix for the last fix -- when has_many is composite and belongs_to is single
489
+
490
+ == 1.0.6 2008-08-06
491
+
492
+ * fix associations create
493
+
494
+ == 1.0.5 2008-07-25
495
+
496
+ * fix for calculations with a group by clause [thx Sirius Black]
497
+
498
+ == 1.0.4 2008-07-15
499
+
500
+ * support for oracle_enhanced adapter [thx Raimonds Simanovskis]
501
+
502
+ == 1.0.3 2008-07-13
503
+
504
+ * more fixes and tests for has many through [thx Menno van der Sman]
505
+
506
+ == 1.0.2 2008-06-07
507
+
508
+ * fix for has many through when through association has composite keys
509
+
510
+ == 1.0.1 2008-06-06
511
+
512
+ * Oracle fixes
513
+
514
+ == 1.0.0 2008-06-05
515
+
516
+ * Support for Rails 2.1
517
+
518
+ == 0.9.93 2008-06-01
519
+
520
+ * set fixed dependency on activerecord 2.0.2
521
+
522
+ == 0.9.92 2008-02-22
523
+
524
+ * Support for has_and_belongs_to_many
525
+
526
+ == 0.9.91 2008-01-27
527
+
528
+ * Incremented activerecord dependency to 2.0.2 [thx emmanuel.pirsch]
529
+
530
+ == 0.9.90 2008-01-27
531
+
532
+ * Trial release for rails/activerecord 2.0.2 supported
533
+
534
+ == 0.9.1 2007-10-28
535
+
536
+ * Migrations fix - allow :primary_key => [:name] to work [no unit test] [thx Shugo Maeda]
537
+
538
+ == 0.9.0 2007-09-28
539
+
540
+ * Added support for polymorphs [thx nerdrew]
541
+ * init.rb file so gem can be installed as a plugin for Rails [thx nerdrew]
542
+ * Added ibm_db support [thx K Venkatasubramaniyan]
543
+ * Support for cleaning dependents [thx K Venkatasubramaniyan]
544
+ * Rafactored db rake tasks into namespaces
545
+ * Added namespaced tests (e.g. mysql:test for test_mysql)
546
+
547
+ == 0.8.6 / 2007-6-12
548
+
549
+ * 1 emergency fix due to Rails Core change
550
+ * Rails v7004 removed #quote; fixed with connection.quote_column_name [thx nerdrew]
551
+
552
+ == 0.8.5 / 2007-6-5
553
+
554
+ * 1 change due to Rails Core change
555
+ * Can no longer use RAILS_CONNECTION_ADAPTERS from Rails core
556
+ * 7 dev improvement:
557
+ * Changed History.txt syntax to rdoc format
558
+ * Added deploy tasks
559
+ * Removed CHANGELOG + migrated into History.txt
560
+ * Changed PKG_NAME -> GEM_NAME in Rakefile
561
+ * Renamed README -> README.txt for :publish_docs task
562
+ * Added :check_version task
563
+ * VER => VERS in rakefile
564
+ * 1 website improvement:
565
+ * website/index.txt includes link to "8 steps to fix other ppls code"
566
+
567
+ == 0.8.4 / 2007-5-3
568
+
569
+ * 1 bugfix
570
+ * Corrected ids_list => ids in the exception message. That'll teach me for not adding unit tests before fixing bugs.
571
+
572
+ == 0.8.3 / 2007-5-3
573
+
574
+ * 1 bugfix
575
+ * Explicit reference to ::ActiveRecord::RecordNotFound
576
+ * 1 website addition:
577
+ * Added routing help [Pete Sumskas]
578
+
579
+ == 0.8.2 / 2007-4-11
580
+
581
+ * 1 major enhancement:
582
+ * Oracle unit tests!! [Darrin Holst]
583
+ * And they work too
584
+
585
+ == 0.8.1 / 2007-4-10
586
+
587
+ * 1 bug fix:
588
+ * Fixed the distinct(count) for oracle (removed 'as')
589
+
590
+ == 0.8.0 / 2007-4-6
591
+
592
+ * 1 major enhancement:
593
+ * Support for calcualtions on associations
594
+ * 2 new DB supported:
595
+ * Tests run on sqlite
596
+ * Tests run on postgresql
597
+ * History.txt to keep track of changes like these
598
+ * Using Hoe for Rakefile
599
+ * Website generator rake tasks
600
+
601
+ == 0.3.3
602
+ * id=
603
+ * create now work
604
+
605
+ == 0.1.4
606
+ * it was important that #{primary_key} for composites --> 'key1,key2' and not 'key1key2' so created PrimaryKeys class
607
+
608
+ == 0.0.1
609
+ * Initial version
610
+ * set_primary_keys(*keys) is the activation class method to transform an ActiveRecord into a composite primary key AR
611
+ * find(*ids) supports the passing of
612
+ * id sets: Foo.find(2,1),
613
+ * lists of id sets: Foo.find([2,1], [7,3], [8,12]),
614
+ * and even stringified versions of the above:
615
+ * Foo.find '2,1' or Foo.find '2,1;7,3'