public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
rails / activerecord / CHANGELOG
100644 1299 lines (816 sloc) 61.928 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
*SVN*
 
* Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
 
* Added better defaults for composed_of, so statements like composed_of :time_zone, :mapping => %w( time_zone time_zone ) can be written without the mapping part (it's now assumed)
 
* Added MacroReflection#macro which will return a symbol describing the macro used (like :composed_of or :has_many) #718, #248 [james@slashetc.com]
 
 
*1.7.0* (24th February, 2005)
 
* Changed the auto-timestamping feature to use ActiveRecord::Base.default_timezone instead of entertaining the parallel ActiveRecord::Base.timestamps_gmt method. The latter is now deprecated and will throw a warning on use (but still work) #710 [Jamis Buck]
 
* Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Usage notes:
 
    1. Key generation uses a sequence "rails_sequence" for all tables. (I couldn't find a simple
        and safe way of passing table-specific sequence information to the adapter.)
    2. Oracle uses DATE or TIMESTAMP datatypes for both dates and times. Consequently I have had to
        resort to some hacks to get data converted to Date or Time in Ruby.
        If the column_name ends in _at (like created_at, updated_at) it's created as a Ruby Time. Else if the
        hours/minutes/seconds are 0, I make it a Ruby Date. Else it's a Ruby Time.
        This is nasty - but if you use Duck Typing you'll probably not care very much.
        In 9i it's tempting to map DATE to Date and TIMESTAMP to Time but I don't think that is
        valid - too many databases use DATE for both.
        Timezones and sub-second precision on timestamps are not supported.
    3. Default values that are functions (such as "SYSDATE") are not supported. This is a
        restriction of the way active record supports default values.
    4. Referential integrity constraints are not fully supported. Under at least
        some circumstances, active record appears to delete parent and child records out of
        sequence and out of transaction scope. (Or this may just be a problem of test setup.)
 
  The OCI8 driver can be retrieved from http://rubyforge.org/projects/ruby-oci8/
 
* Added option :schema_order to the PostgreSQL adapter to support the use of multiple schemas per database #697 [YuriSchimke]
 
* Optimized the SQL used to generate has_and_belongs_to_many queries by listing the join table first #693 [yerejm]
 
* Fixed that when using validation macros with a custom message, if you happened to use single quotes in the message string you would get a parsing error #657 [tonka]
 
* Fixed that Active Record would throw Broken Pipe errors with FCGI when the MySQL connection timed out instead of reconnecting #428 [Nicholas Seckar]
 
* Added options to specify an SSL connection for MySQL. Define the following attributes in the connection config (config/database.yml in Rails) to use it: sslkey, sslcert, sslca, sslcapath, sslcipher. To use SSL with no client certs, just set :sslca = '/dev/null'. http://dev.mysql.com/doc/mysql/en/secure-connections.html #604 [daniel@nightrunner.com]
 
* Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
 
* Fixed that find_by_* would fail when column names had numbers #670 [demetrius]
 
* Fixed the SQL Server adapter on a bunch of issues #667 [DeLynn]
 
    1. Created a new columns method that is much cleaner.
    2. Corrected a problem with the select and select_all methods
       that didn't account for the LIMIT clause being passed into raw SQL statements.
    3. Implemented the string_to_time method in order to create proper instances of the time class.
    4. Added logic to the simplified_type method that allows the database to specify the scale of float data.
    5. Adjusted the quote_column_name to account for the fact that MS SQL is bothered by a forward slash in the data string.
 
* Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
 
* Added validates_each that validates each specified attribute against a block #610 [bitsweat]. Example:
    
    class Person < ActiveRecord::Base
      validates_each :first_name, :last_name do |record, attr|
        record.errors.add attr, 'starts with z.' if attr[0] == ?z
      end
    end
 
* Added :allow_nil as an explicit option for validates_length_of, so unless that's set to true having the attribute as nil will also return an error if a range is specified as :within #610 [bitsweat]
 
* Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
 
    class Person < ActiveRecord::Base
      validate { |person| person.errors.add("title", "will never be valid") if SHOULD_NEVER_BE_VALID }
    end
 
* Addded validation for validate all the associated objects before declaring failure with validates_associated #618 [Tim Bates]
 
* Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]. Example:
 
    class Project < ActiveRecord::Base
      primary_key "sysid"
      table_name "XYZ_PROJECT"
      inheritance_column { original_inheritance_column + "_id" }
    end
 
* Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
 
 
*1.6.0* (January 25th, 2005)
 
* Added that has_many association build and create methods can take arrays of record data like Base#create and Base#build to build/create multiple records at once.
 
* Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336
 
* Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once.
 
* Added the option of supplying an array of ids and attributes to Base#update, so that multiple records can be updated at once (inspired by #526/Duane Johnson). Example
 
    people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
    Person.update(people.keys, people.values)
 
* Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the automated timestamping use GMT instead of local time #520 [Scott Baron]
 
* Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
 
* Fixed that the dynamic finders didn't treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
 
* Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [bitsweat]
 
* Added that has_and_belongs_to_many associations with additional attributes also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson]
 
* Fixed that records fetched with piggy-back attributes or through rich has_and_belongs_to_many associations couldn't be saved due to the extra attributes not part of the table #522 [Eric Anderson]
 
* Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
 
* Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
 
* Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
 
* Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
 
 
*1.5.1* (January 18th, 2005)
 
* Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
 
* Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
 
 
*1.5.0* (January 17th, 2005)
 
* Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
 
* Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]. Example:
 
    class Book < ActiveRecord::Base
      has_many :pages
      belongs_to :library
    
      validates_associated :pages, :library
    end
    
* Added support for associating unsaved objects #402 [Tim Bates]. Rules that govern this addition:
 
    == Unsaved objects and associations
    
    You can manipulate objects and associations before they are saved to the database, but there is some special behaviour you should be
    aware of, mostly involving the saving of associated objects.
    
    === One-to-one associations
    
    * Assigning an object to a has_one association automatically saves that object, and the object being replaced (if there is one), in
      order to update their primary keys - except if the parent object is unsaved (new_record? == true).
    * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns false and the assignment
      is cancelled.
    * If you wish to assign an object to a has_one association without saving it, use the #association.build method (documented below).
    * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does
      not save the parent either.
    
    === Collections
    
    * Adding an object to a collection (has_many or has_and_belongs_to_many) automatically saves that object, except if the parent object
      (the owner of the collection) is not yet stored in the database.
    * If saving any of the objects being added to a collection (via #push or similar) fails, then #push returns false.
    * You can add an object to a collection without automatically saving it by using the #collection.build method (documented below).
    * All unsaved (new_record? == true) members of the collection are automatically saved when the parent is saved.
 
* Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
 
* Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
 
* Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]
 
* Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
 
* Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
 
* Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the
  collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If
  it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards,
  it'll take one less SELECT query if you use length.
 
* Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
 
* Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
 
* Fixed default scope of acts_as_list from "1" to "1 = 1", so it'll work in PostgreSQL (among other places) #427 [Alexey]
 
* Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
 
* Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [bitsweat]
 
* Added support for the new protocol spoken by MySQL 4.1.1+ servers for the Ruby/MySQL adapter that ships with Rails #440 [Matt Mower]
 
* Added that Observers can use the observes class method instead of overwriting self.observed_class().
 
    Before:
      class ListSweeper < ActiveRecord::Base
        def self.observed_class() [ List, Item ]
      end
    
    After:
      class ListSweeper < ActiveRecord::Base
        observes List, Item
      end
 
* Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
 
* Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
 
* Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag.
 
    Before: topic.update_attribute(:approved, !approved?)
    After : topic.toggle!(:approved)
 
* Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Example:
 
    page.views # => 1
    page.increment!(:views) # executes an UPDATE statement
    page.views # => 2
    
    page.increment(:views).increment!(:views)
    page.views # => 4
 
* Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
 
 
*1.4.0* (January 4th, 2005)
 
* Added automated optimistic locking if the field <tt>lock_version</tt> is present. Each update to the
  record increments the lock_version column and the locking facilities ensure that records instantiated twice
  will let the last one saved raise a StaleObjectError if the first was also updated. Example:
  
    p1 = Person.find(1)
    p2 = Person.find(1)
    
    p1.first_name = "Michael"
    p1.save
    
    p2.first_name = "should fail"
    p2.save # Raises a ActiveRecord::StaleObjectError
  
  You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,
  or otherwise apply the business logic needed to resolve the conflict.
 
  #384 [Michael Koziarski]
 
* Added dynamic attribute-based finders as a cleaner way of getting objects by simple queries without turning to SQL.
  They work by appending the name of an attribute to <tt>find_by_</tt>, so you get finders like <tt>Person.find_by_user_name,
  Payment.find_by_transaction_id</tt>. So instead of writing <tt>Person.find_first(["user_name = ?", user_name])</tt>, you just do
  <tt>Person.find_by_user_name(user_name)</tt>.
  
  It's also possible to use multiple attributes in the same find by separating them with "_and_", so you get finders like
  <tt>Person.find_by_user_name_and_password</tt> or even <tt>Payment.find_by_purchaser_and_state_and_country</tt>. So instead of writing
  <tt>Person.find_first(["user_name = ? AND password = ?", user_name, password])</tt>, you just do
  <tt>Person.find_by_user_name_and_password(user_name, password)</tt>.
 
  While primarily a construct for easier find_firsts, it can also be used as a construct for find_all by using calls like
  <tt>Payment.find_all_by_amount(50)</tt> that is turned into <tt>Payment.find_all(["amount = ?", 50])</tt>. This is something not as equally useful,
  though, as it's not possible to specify the order in which the objects are returned.
 
* Added block-style for callbacks #332 [bitsweat].
 
    Before:
      before_destroy(Proc.new{ |record| Person.destroy_all "firm_id = #{record.id}" })
    
    After:
      before_destroy { |record| Person.destroy_all "firm_id = #{record.id}" }
 
* Added :counter_cache option to acts_as_tree that works just like the one you can define on belongs_to #371 [Josh]
 
* Added Base.default_timezone accessor that determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates
  and times from the database. This is set to :local by default.
 
* Added the possibility for adapters to overwrite add_limit! to implement a different limiting scheme than "LIMIT X" used by MySQL, PostgreSQL, and SQLite.
 
* Added the possibility of having objects with acts_as_list created before their scope is available or...
 
* Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]
 
* Added the final touches to the Microsoft SQL Server adapter by Joey Gibson that makes it suitable for actual use #394 [DeLynn Barry]
 
* Added that Base#find takes an optional options hash, including :conditions. Base#find_on_conditions deprecated in favor of #find with :conditions #407 [bitsweat]
 
* Added HasManyAssociation#count that works like Base#count #413 [intinig]
 
* Fixed handling of binary content in blobs and similar fields for Ruby/MySQL and SQLite #409 [xal]
 
* Fixed a bug in the Ruby/MySQL that caused binary content to be escaped badly and come back mangled #405 [Tobias Luetke]
 
* Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it.
  If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat]
 
* Fixed broken transactions that were actually only running object-level and not db level transactions [andreas]
 
* Fixed that validates_uniqueness_of used 'id' instead of defined primary key #406
 
* Fixed that the overwritten respond_to? method didn't take two parameters like the original #391
 
* Fixed quoting in validates_format_of that would allow some rules to pass regardless of input #390 [Dmitry V. Sabanin]
 
 
*1.3.0* (December 23, 2004)
 
* Added a require_association hook on const_missing that makes it possible to use any model class without requiring it first. This makes STI look like:
 
    before:
      require_association 'person'
      class Employee < Person
      end
    
    after:
      class Employee < Person
      end
 
  This also reduces the usefulness of Controller.model in Action Pack to currently only being for documentation purposes.
 
* Added that Base.update_all and Base.delete_all return an integer of the number of affected rows #341
 
* Added scope option to validation_uniqueness #349 [Kent Sibilev]
 
* Added respondence to *_before_type_cast for all attributes to return their string-state before they were type casted by the column type.
  This is helpful for getting "100,000" back on a integer-based validation where the value would normally be "100".
 
* Added allow_nil options to validates_inclusion_of so that validation is only triggered if the attribute is not nil [what-a-day]
 
* Added work-around for PostgreSQL and the problem of getting fixtures to be created from id 1 on each test case.
  This only works for auto-incrementing primary keys called "id" for now #359 [Scott Baron]
 
* Added Base#clear_association_cache to empty all the cached associations #347 [Tobias Luetke]
 
* Added more informative exceptions in establish_connection #356 [bitsweat]
 
* Added Base#update_attributes that'll accept a hash of attributes and save the record (returning true if it passed validation, false otherwise).
 
    Before:
      person.attributes = @params["person"]
      person.save
    
    Now:
      person.update_attributes(@params["person"])
 
* Added Base.destroy and Base.delete to remove records without holding a reference to them first.
 
* Added that query benchmarking will only happen if its going to be logged anyway #344
 
* Added higher_item and lower_item as public methods for acts_as_list #342 [Tobias Luetke]
 
* Fixed that options[:counter_sql] was overwritten with interpolated sql rather than original sql #355 [bitsweat]
 
* Fixed that overriding an attribute's accessor would be disregarded by add_on_empty and add_on_boundary_breaking because they simply used
  the attributes[] hash instead of checking for @base.respond_to?(attr.to_s). [Marten]
 
* Fixed that Base.table_name would expect a parameter when used in has_and_belongs_to_many joins [Anna Lissa Cruz]
 
* Fixed that nested transactions now work by letting the outer most transaction have the responsibilty of starting and rolling back the transaction.
  If any of the inner transactions swallow the exception raised, though, the transaction will not be rolled back. So always let the transaction
  bubble up even when you've dealt with local issues. Closes #231 and #340.
 
* Fixed validates_{confirmation,acceptance}_of to only happen when the virtual attributes are not nil #348 [dpiddy@gmail.com]
 
* Changed the interface on AbstractAdapter to require that adapters return the number of affected rows on delete and update operations.
 
* Fixed the automated timestamping feature when running under Rails' development environment that resets the inheritable attributes on each request.
 
 
 
*1.2.0*
 
* Added Base.validates_inclusion_of that validates whether the value of the specified attribute is available in a particular enumerable
  object. [what-a-day]
 
    class Person < ActiveRecord::Base
      validates_inclusion_of :gender, :in=>%w( m f ), :message=>"woah! what are you then!??!!"
      validates_inclusion_of :age, :in=>0..99
    end
 
* Added acts_as_list that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom. [Tobias Luetke] Example:
 
    class TodoItem < ActiveRecord::Base
      acts_as_list :scope => :todo_list_id
      belongs_to :todo_list
    end
 
* Added acts_as_tree that can decorates an existing class with a many to many relationship with itself. Perfect for categories in
  categories and the likes. [Tobias Luetke]
 
* Added that Active Records will automatically record creation and/or update timestamps of database objects if fields of the names
  created_at/created_on or updated_at/updated_on are present. [Tobias Luetke]
 
* Added Base.default_error_messages as a hash of all the error messages used in the validates_*_of so they can be changed in one place [Tobias Luetke]
 
* Added automatic transaction block around AssociationCollection.<<, AssociationCollection.delete, and AssociationCollection.destroy_all
 
* Fixed that Base#find will return an array if given an array -- regardless of the number of elements #270 [Marten]
 
* Fixed that has_and_belongs_to_many would generate bad sql when naming conventions differed from using vanilla "id" everywhere [RedTerror]
 
* Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Example:
 
    ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'bad_class!'.
    This error is raised because the column 'type' is reserved for storing the class in case of inheritance.
    Please rename this column if you didn't intend it to be used for storing the inheritance class or
    overwrite Company.inheritance_column to use another column for that information.
 
* Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance won't
  have any magic side effects.
 
* Added the possibility of marking fields as being in error without adding a message (using nil) to it that'll get displayed wth full_messages #208 [mjobin]
 
* Fixed Base.errors to be indifferent as to whether strings or symbols are used. Examples:
 
    Before:
      errors.add(:name, "must be shorter") if name.size > 10
      errors.on(:name) # => "must be shorter"
      errors.on("name") # => nil
 
    After:
      errors.add(:name, "must be shorter") if name.size > 10
      errors.on(:name) # => "must be shorter"
      errors.on("name") # => "must be shorter"
 
* Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching
  it against the regular expression provided. [Marcel]
 
    class Person < ActiveRecord::Base
      validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/, :on => :create
    end
 
* Added Base.validates_length_of that delegates to add_on_boundary_breaking #312 [Tobias Luetke]. Example:
 
    Validates that the specified attribute matches the length restrictions supplied in either:
    
      - configuration[:minimum]
      - configuration[:maximum]
      - configuration[:is]
      - configuration[:within] (aka. configuration[:in])
    
    Only one option can be used at a time.
    
      class Person < ActiveRecord::Base
        validates_length_of :first_name, :maximum=>30
        validates_length_of :last_name, :maximum=>30, :message=>"less than %d if you don't mind"
        validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
        validates_length_of :fav_bra_size, :minimum=>1, :too_short=>"please enter at least %d character"
        validates_length_of :smurf_leader, :is=>4, :message=>"papa is spelled with %d characters... don't play me."
      end
    
* Added Base.validate_presence as an alternative to implementing validate and doing errors.add_on_empty yourself.
 
* Added Base.validates_uniqueness_of that alidates whether the value of the specified attributes are unique across the system.
  Useful for making sure that only one user can be named "davidhh".
  
    class Person < ActiveRecord::Base
      validates_uniqueness_of :user_name
    end
  
  When the record is created, a check is performed to make sure that no record exist in the database with the given value for the specified
  attribute (that maps to a column). When the record is updated, the same check is made but disregarding the record itself.
 
 
* Added Base.validates_confirmation_of that encapsulates the pattern of wanting to validate a password or email address field with a confirmation. Example:
 
     Model:
       class Person < ActiveRecord::Base
         validates_confirmation_of :password
       end
  
     View:
       <%= password_field "person", "password" %>
       <%= password_field "person", "password_confirmation" %>
  
   The person has to already have a password attribute (a column in the people table), but the password_confirmation is virtual.
   It exists only as an in-memory variable for validating the password. This check is performed both on create and update.
 
 
* Added Base.validates_acceptance_of that encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example:
  
   class Person < ActiveRecord::Base
     validates_acceptance_of :terms_of_service
   end
  
  The terms_of_service attribute is entirely virtual. No database column is needed. This check is performed both on create and update.
 
  NOTE: The agreement is considered valid if it's set to the string "1". This makes it easy to relate it to an HTML checkbox.
 
  
* Added validation macros to make the stackable just like the lifecycle callbacks. Examples:
 
    class Person < ActiveRecord::Base
      validate { |record| record.errors.add("name", "too short") unless name.size > 10 }
      validate { |record| record.errors.add("name", "too long") unless name.size < 20 }
      validate_on_create :validate_password
      
      private
        def validate_password
          errors.add("password", "too short") unless password.size > 6
        end
    end
 
* Added the option for sanitizing find_by_sql and the offset parts in regular finds [Sam Stephenson]. Examples:
 
    Project.find_all ["category = ?", category_name], "created ASC", ["? OFFSET ?", 15, 20]
    Post.find_by_sql ["SELECT * FROM posts WHERE author = ? AND created > ?", author_id, start_date]
 
* Fixed value quoting in all generated SQL statements, so that integers are not surrounded in quotes and that all sanitation are happening
  through the database's own quoting routine. This should hopefully make it lots easier for new adapters that doesn't accept '1' for integer
  columns.
 
* Fixed has_and_belongs_to_many guessing of foreign key so that keys are generated correctly for models like SomeVerySpecialClient
  [Florian Weber]
 
* Added counter_sql option for has_many associations [bitsweat]. Documentation:
 
    <tt>:counter_sql</tt> - specify a complete SQL statement to fetch the size of the association. If +:finder_sql+ is
    specified but +:counter_sql+, +:counter_sql+ will be generated by replacing SELECT ... FROM with SELECT COUNT(*) FROM.
 
* Fixed that methods wrapped in callbacks still return their original result #260 [bitsweat]
 
* Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]
 
* Added named bind-style variable interpolation #281 [Michael Koziarski]. Example:
 
    Person.find(["id = :id and first_name = :first_name", { :id => 5, :first_name = "bob' or 1=1" }])
 
* Added bind-style variable interpolation for the condition arrays that uses the adapter's quote method [Michael Koziarski]
 
  Before:
    find_first([ "user_name = '%s' AND password = '%s'", user_name, password ])]
    find_first([ "firm_id = %s", firm_id ])] # unsafe!
 
  After:
    find_first([ "user_name = ? AND password = ?", user_name, password ])]
    find_first([ "firm_id = ?", firm_id ])]
 
* Added CSV format for fixtures #272 [what-a-day]. (See the new and expanded documentation on fixtures for more information)
 
* Fixed fixtures using primary key fields called something else than "id" [dave]
 
* Added proper handling of time fields that are turned into Time objects with the dummy date of 2000/1/1 [HariSeldon]
 
* Added reverse order of deleting fixtures, so referential keys can be maintained #247 [Tim Bates]
 
* Added relative path search for sqlite dbfiles in database.yml (if RAILS_ROOT is defined) #233 [bitsweat]
 
* Added option to establish_connection where you'll be able to leave out the parameter to have it use the RAILS_ENV environment variable
 
* Fixed problems with primary keys and postgresql sequences (#230) [Tim Bates]
 
* Added reloading for associations under cached environments like FastCGI and mod_ruby. This makes it possible to use those environments for development.
  This is turned on by default, but can be turned off with ActiveRecord::Base.reload_dependencies = false in production environments.
 
  NOTE: This will only have an effect if you let the associations manage the requiring of model classes. All libraries loaded through
  require will be "forever" cached. You can, however, use ActiveRecord::Base.load_or_require("library") to get this behavior outside of the
  auto-loading associations.
 
* Added ERB capabilities to the fixture files for dynamic fixture generation. You don't need to do anything, just include ERB blocks like:
 
    david:
      id: 1
      name: David
 
    jamis:
      id: 2
      name: Jamis
 
    <% for digit in 3..10 %>
    dev_<%= digit %>:
      id: <%= digit %>
      name: fixture_<%= digit %>
    <% end %>
 
* Changed the yaml fixture searcher to look in the root of the fixtures directory, so when you before could have something like:
 
    fixtures/developers/fixtures.yaml
    fixtures/accounts/fixtures.yaml
  
  ...you now need to do:
  
    fixtures/developers.yaml
    fixtures/accounts.yaml
 
* Changed the fixture format from:
 
    name: david
    data:
     id: 1
     name: David Heinemeier Hansson
     birthday: 1979-10-15
     profession: Systems development
    ---
    name: steve
    data:
     id: 2
     name: Steve Ross Kellock
     birthday: 1974-09-27
     profession: guy with keyboard
 
  ...to:
 
    david:
     id: 1
     name: David Heinemeier Hansson
     birthday: 1979-10-15
     profession: Systems development
    
    steve:
     id: 2
     name: Steve Ross Kellock
     birthday: 1974-09-27
     profession: guy with keyboard
    
  The change is NOT backwards compatible. Fixtures written in the old YAML style needs to be rewritten!
 
* All associations will now attempt to require the classes that they associate to. Relieving the need for most explicit 'require' statements.
 
 
*1.1.0* (34)
 
* Added automatic fixture setup and instance variable availability. Fixtures can also be automatically
  instantiated in instance variables relating to their names using the following style:
 
    class FixturesTest < Test::Unit::TestCase
      fixtures :developers # you can add more with comma separation
 
      def test_developers
        assert_equal 3, @developers.size # the container for all the fixtures is automatically set
        assert_kind_of Developer, @david # works like @developers["david"].find
        assert_equal "David Heinemeier Hansson", @david.name
      end
    end
 
* Added HasAndBelongsToManyAssociation#push_with_attributes(object, join_attributes) that can create associations in the join table with additional
  attributes. This is really useful when you have information that's only relevant to the join itself, such as a "added_on" column for an association
  between post and category. The added attributes will automatically be injected into objects retrieved through the association similar to the piggy-back
  approach:
  
    post.categories.push_with_attributes(category, :added_on => Date.today)
    post.categories.first.added_on # => Date.today
    
  NOTE: The categories table doesn't have a added_on column, it's the categories_post join table that does!
 
* Fixed that :exclusively_dependent and :dependent can't be activated at the same time on has_many associations [bitsweat]
 
* Fixed that database passwords couldn't be all numeric [bitsweat]
 
* Fixed that calling id would create the instance variable for new_records preventing them from being saved correctly [bitsweat]
 
* Added sanitization feature to HasManyAssociation#find_all so it works just like Base.find_all [Sam Stephenson/bitsweat]
 
* Added that you can pass overlapping ids to find wi