composite_primary_keys 7.0.16 → 8.0.0

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