activerecord 1.15.6 → 2.0.0

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

Potentially problematic release.


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

Files changed (185) hide show
  1. data/CHANGELOG +2454 -34
  2. data/README +1 -1
  3. data/RUNNING_UNIT_TESTS +3 -34
  4. data/Rakefile +98 -77
  5. data/install.rb +1 -1
  6. data/lib/active_record.rb +13 -22
  7. data/lib/active_record/aggregations.rb +38 -49
  8. data/lib/active_record/associations.rb +452 -333
  9. data/lib/active_record/associations/association_collection.rb +66 -20
  10. data/lib/active_record/associations/association_proxy.rb +9 -8
  11. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +46 -51
  12. data/lib/active_record/associations/has_many_association.rb +21 -57
  13. data/lib/active_record/associations/has_many_through_association.rb +38 -18
  14. data/lib/active_record/associations/has_one_association.rb +30 -14
  15. data/lib/active_record/attribute_methods.rb +253 -0
  16. data/lib/active_record/base.rb +719 -494
  17. data/lib/active_record/calculations.rb +62 -63
  18. data/lib/active_record/callbacks.rb +57 -83
  19. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +38 -9
  20. data/lib/active_record/connection_adapters/abstract/database_statements.rb +56 -15
  21. data/lib/active_record/connection_adapters/abstract/query_cache.rb +87 -0
  22. data/lib/active_record/connection_adapters/abstract/quoting.rb +23 -12
  23. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +191 -62
  24. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +37 -34
  25. data/lib/active_record/connection_adapters/abstract_adapter.rb +28 -17
  26. data/lib/active_record/connection_adapters/mysql_adapter.rb +119 -37
  27. data/lib/active_record/connection_adapters/postgresql_adapter.rb +473 -210
  28. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +34 -0
  29. data/lib/active_record/connection_adapters/sqlite_adapter.rb +91 -107
  30. data/lib/active_record/fixtures.rb +503 -113
  31. data/lib/active_record/locking/optimistic.rb +72 -34
  32. data/lib/active_record/migration.rb +80 -57
  33. data/lib/active_record/observer.rb +13 -10
  34. data/lib/active_record/query_cache.rb +16 -57
  35. data/lib/active_record/reflection.rb +35 -38
  36. data/lib/active_record/schema.rb +5 -5
  37. data/lib/active_record/schema_dumper.rb +35 -13
  38. data/lib/active_record/serialization.rb +98 -0
  39. data/lib/active_record/serializers/json_serializer.rb +71 -0
  40. data/lib/active_record/{xml_serialization.rb → serializers/xml_serializer.rb} +90 -83
  41. data/lib/active_record/timestamp.rb +20 -21
  42. data/lib/active_record/transactions.rb +39 -43
  43. data/lib/active_record/validations.rb +256 -107
  44. data/lib/active_record/version.rb +3 -3
  45. data/lib/activerecord.rb +1 -0
  46. data/test/aaa_create_tables_test.rb +15 -2
  47. data/test/abstract_unit.rb +24 -17
  48. data/test/active_schema_test_mysql.rb +20 -8
  49. data/test/adapter_test.rb +23 -5
  50. data/test/adapter_test_sqlserver.rb +15 -1
  51. data/test/aggregations_test.rb +16 -1
  52. data/test/all.sh +2 -2
  53. data/test/associations/ar_joins_test.rb +0 -0
  54. data/test/associations/callbacks_test.rb +51 -30
  55. data/test/associations/cascaded_eager_loading_test.rb +1 -29
  56. data/test/associations/eager_singularization_test.rb +145 -0
  57. data/test/associations/eager_test.rb +42 -6
  58. data/test/associations/extension_test.rb +6 -1
  59. data/test/associations/inner_join_association_test.rb +88 -0
  60. data/test/associations/join_model_test.rb +47 -16
  61. data/test/associations_test.rb +449 -226
  62. data/test/attribute_methods_test.rb +97 -0
  63. data/test/base_test.rb +251 -105
  64. data/test/binary_test.rb +22 -27
  65. data/test/calculations_test.rb +37 -5
  66. data/test/callbacks_test.rb +23 -0
  67. data/test/connection_test_firebird.rb +2 -2
  68. data/test/connection_test_mysql.rb +30 -0
  69. data/test/connections/native_mysql/connection.rb +3 -0
  70. data/test/connections/native_sqlite/connection.rb +5 -14
  71. data/test/connections/native_sqlite3/connection.rb +5 -14
  72. data/test/connections/native_sqlite3/in_memory_connection.rb +1 -1
  73. data/test/{copy_table_sqlite.rb → copy_table_test_sqlite.rb} +8 -3
  74. data/test/datatype_test_postgresql.rb +178 -27
  75. data/test/{empty_date_time_test.rb → date_time_test.rb} +13 -1
  76. data/test/defaults_test.rb +8 -1
  77. data/test/deprecated_finder_test.rb +7 -128
  78. data/test/finder_test.rb +192 -54
  79. data/test/fixtures/all/developers.yml +0 -0
  80. data/test/fixtures/all/people.csv +0 -0
  81. data/test/fixtures/all/tasks.yml +0 -0
  82. data/test/fixtures/author.rb +12 -5
  83. data/test/fixtures/binaries.yml +130 -435
  84. data/test/fixtures/category.rb +6 -0
  85. data/test/fixtures/company.rb +8 -1
  86. data/test/fixtures/computer.rb +1 -0
  87. data/test/fixtures/contact.rb +16 -0
  88. data/test/fixtures/customer.rb +2 -2
  89. data/test/fixtures/db_definitions/db2.drop.sql +1 -0
  90. data/test/fixtures/db_definitions/db2.sql +4 -0
  91. data/test/fixtures/db_definitions/firebird.drop.sql +3 -1
  92. data/test/fixtures/db_definitions/firebird.sql +6 -0
  93. data/test/fixtures/db_definitions/frontbase.drop.sql +1 -0
  94. data/test/fixtures/db_definitions/frontbase.sql +5 -0
  95. data/test/fixtures/db_definitions/openbase.sql +41 -25
  96. data/test/fixtures/db_definitions/oracle.drop.sql +2 -0
  97. data/test/fixtures/db_definitions/oracle.sql +5 -0
  98. data/test/fixtures/db_definitions/postgresql.drop.sql +7 -0
  99. data/test/fixtures/db_definitions/postgresql.sql +87 -58
  100. data/test/fixtures/db_definitions/postgresql2.sql +1 -2
  101. data/test/fixtures/db_definitions/schema.rb +280 -0
  102. data/test/fixtures/db_definitions/schema2.rb +11 -0
  103. data/test/fixtures/db_definitions/sqlite.drop.sql +1 -0
  104. data/test/fixtures/db_definitions/sqlite.sql +4 -0
  105. data/test/fixtures/db_definitions/sybase.drop.sql +1 -0
  106. data/test/fixtures/db_definitions/sybase.sql +4 -0
  107. data/test/fixtures/developer.rb +10 -0
  108. data/test/fixtures/example.log +1 -0
  109. data/test/fixtures/flowers.jpg +0 -0
  110. data/test/fixtures/item.rb +7 -0
  111. data/test/fixtures/items.yml +4 -0
  112. data/test/fixtures/joke.rb +0 -3
  113. data/test/fixtures/matey.rb +4 -0
  114. data/test/fixtures/mateys.yml +4 -0
  115. data/test/fixtures/minimalistic.rb +2 -0
  116. data/test/fixtures/minimalistics.yml +2 -0
  117. data/test/fixtures/mixins.yml +2 -100
  118. data/test/fixtures/parrot.rb +13 -0
  119. data/test/fixtures/parrots.yml +27 -0
  120. data/test/fixtures/parrots_pirates.yml +7 -0
  121. data/test/fixtures/pirate.rb +5 -0
  122. data/test/fixtures/pirates.yml +9 -0
  123. data/test/fixtures/post.rb +1 -0
  124. data/test/fixtures/project.rb +3 -2
  125. data/test/fixtures/reserved_words/distinct.yml +5 -0
  126. data/test/fixtures/reserved_words/distincts_selects.yml +11 -0
  127. data/test/fixtures/reserved_words/group.yml +14 -0
  128. data/test/fixtures/reserved_words/select.yml +8 -0
  129. data/test/fixtures/reserved_words/values.yml +7 -0
  130. data/test/fixtures/ship.rb +3 -0
  131. data/test/fixtures/ships.yml +5 -0
  132. data/test/fixtures/tagging.rb +4 -0
  133. data/test/fixtures/taggings.yml +8 -1
  134. data/test/fixtures/topic.rb +13 -1
  135. data/test/fixtures/treasure.rb +4 -0
  136. data/test/fixtures/treasures.yml +10 -0
  137. data/test/fixtures_test.rb +205 -24
  138. data/test/inheritance_test.rb +7 -1
  139. data/test/json_serialization_test.rb +180 -0
  140. data/test/lifecycle_test.rb +1 -1
  141. data/test/locking_test.rb +85 -2
  142. data/test/migration_test.rb +206 -40
  143. data/test/mixin_test.rb +13 -515
  144. data/test/pk_test.rb +3 -6
  145. data/test/query_cache_test.rb +104 -0
  146. data/test/reflection_test.rb +16 -0
  147. data/test/reserved_word_test_mysql.rb +177 -0
  148. data/test/schema_dumper_test.rb +38 -3
  149. data/test/serialization_test.rb +47 -0
  150. data/test/transactions_test.rb +74 -23
  151. data/test/unconnected_test.rb +1 -1
  152. data/test/validations_test.rb +322 -32
  153. data/test/xml_serialization_test.rb +121 -44
  154. metadata +48 -41
  155. data/examples/associations.rb +0 -87
  156. data/examples/shared_setup.rb +0 -15
  157. data/examples/validation.rb +0 -85
  158. data/lib/active_record/acts/list.rb +0 -256
  159. data/lib/active_record/acts/nested_set.rb +0 -211
  160. data/lib/active_record/acts/tree.rb +0 -96
  161. data/lib/active_record/connection_adapters/db2_adapter.rb +0 -228
  162. data/lib/active_record/connection_adapters/firebird_adapter.rb +0 -728
  163. data/lib/active_record/connection_adapters/frontbase_adapter.rb +0 -861
  164. data/lib/active_record/connection_adapters/openbase_adapter.rb +0 -350
  165. data/lib/active_record/connection_adapters/oracle_adapter.rb +0 -690
  166. data/lib/active_record/connection_adapters/sqlserver_adapter.rb +0 -591
  167. data/lib/active_record/connection_adapters/sybase_adapter.rb +0 -662
  168. data/lib/active_record/deprecated_associations.rb +0 -104
  169. data/lib/active_record/deprecated_finders.rb +0 -44
  170. data/lib/active_record/vendor/simple.rb +0 -693
  171. data/lib/active_record/wrappers/yaml_wrapper.rb +0 -15
  172. data/lib/active_record/wrappings.rb +0 -58
  173. data/test/connections/native_sqlserver/connection.rb +0 -23
  174. data/test/connections/native_sqlserver_odbc/connection.rb +0 -25
  175. data/test/deprecated_associations_test.rb +0 -396
  176. data/test/fixtures/db_definitions/mysql.drop.sql +0 -32
  177. data/test/fixtures/db_definitions/mysql.sql +0 -234
  178. data/test/fixtures/db_definitions/mysql2.drop.sql +0 -2
  179. data/test/fixtures/db_definitions/mysql2.sql +0 -5
  180. data/test/fixtures/db_definitions/sqlserver.drop.sql +0 -34
  181. data/test/fixtures/db_definitions/sqlserver.sql +0 -243
  182. data/test/fixtures/db_definitions/sqlserver2.drop.sql +0 -2
  183. data/test/fixtures/db_definitions/sqlserver2.sql +0 -5
  184. data/test/fixtures/mixin.rb +0 -63
  185. data/test/mixin_nested_set_test.rb +0 -196
data/CHANGELOG CHANGED
@@ -1,30 +1,331 @@
1
- *1.15.6* (November 24th, 2007)
1
+ *2.0.0* (December 6th, 2007)
2
+
3
+ * Anchor DateTimeTest to fixed DateTime instead of a variable value based on Time.now#advance#to_datetime, so that this test passes on 64-bit platforms running Ruby 1.8.6+ [Geoff Buesing]
4
+
5
+ * Fixed that the Query Cache should just be ignored if the database is misconfigured (so that the "About your applications environment" works even before the database has been created) [DHH]
6
+
7
+ * Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped #10385 [norbert]
8
+
9
+ * Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
10
+
11
+ * Document how the :include option can be used in Calculations::calculate. Closes #7446 [adamwiggins, ultimoamore]
12
+
13
+ * Fix typo in documentation for polymorphic associations w/STI. Closes #7461 [johnjosephbachir]
14
+
15
+ * Reveal that the type option in migrations can be any supported column type for your database but also include caveat about agnosticism. Closes #7531 [adamwiggins, mikong]
16
+
17
+ * More complete documentation for find_by_sql. Closes #7912 [fearoffish]
18
+
19
+ * Added ActiveRecord::Base#becomes to turn a record into one of another class (mostly relevant for STIs) [DHH]. Example:
20
+
21
+ render :partial => @client.becomes(Company) # renders companies/company instead of clients/client
22
+
23
+ * Fixed that to_xml should not automatically pass :procs to associations included with :include #10162 [chuyeow]
24
+
25
+ * Fix documentation typo introduced in [8250]. Closes #10339 [Henrik N]
26
+
27
+ * Foxy fixtures: support single-table inheritance. #10234 [tom]
28
+
29
+ * Foxy fixtures: allow mixed usage to make migration easier and more attractive. #10004 [lotswholetime]
30
+
31
+ * Make the record_timestamps class-inheritable so it can be set per model. #10004 [tmacedo]
32
+
33
+ * Allow validates_acceptance_of to use a real attribute instead of only virtual (so you can record that the acceptance occured) #7457 [ambethia]
34
+
35
+ * DateTimes use Ruby's default calendar reform setting. #10201 [Geoff Buesing]
36
+
37
+ * Dynamic finders on association collections respect association :order and :limit. #10211, #10227 [Patrick Joyce, Rick Olson, Jack Danger Canty]
38
+
39
+ * Add 'foxy' support for fixtures of polymorphic associations. #10183 [jbarnette, David Lowenfels]
40
+
41
+ * validates_inclusion_of and validates_exclusion_of allow formatted :message strings. #8132 [devrieda, Mike Naberezny]
42
+
43
+ * attr_readonly behaves well with optimistic locking. #10188 [Nick Bugajski]
44
+
45
+ * Base#to_xml supports the nil="true" attribute like Hash#to_xml. #8268 [Catfish]
46
+
47
+ * Change plings to the more conventional quotes in the documentation. Closes #10104 [danger]
48
+
49
+ * Fix HasManyThrough Association so it uses :conditions on the HasMany Association. Closes #9729 [danger]
50
+
51
+ * Ensure that column names are quoted. Closes #10134 [wesley.moxam]
52
+
53
+ * Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]
54
+
55
+ * Enhance explanation with more examples for attr_accessible macro. Closes #8095 [fearoffish, Marcel Molina]
56
+
57
+ * Update association/method mapping table to refected latest collection methods for has_many :through. Closes #8772 [lifofifo]
58
+
59
+ * Explain semantics of having several different AR instances in a transaction block. Closes #9036 [jacobat, Marcel Molina]
60
+
61
+ * Update Schema documentation to use updated sexy migration notation. Closes #10086 [sjgman9]
62
+
63
+ * Make fixtures work with the new test subclasses. [tarmo, Koz]
64
+
65
+ * Introduce finder :joins with associations. Same :include syntax but with inner rather than outer joins. #10012 [RubyRedRick]
66
+ # Find users with an avatar
67
+ User.find(:all, :joins => :avatar)
68
+
69
+ # Find posts with a high-rated comment.
70
+ Post.find(:all, :joins => :comments, :conditions => 'comments.rating > 3')
71
+
72
+ * Associations: speedup duplicate record check. #10011 [lifofifo]
73
+
74
+ * Make sure that << works on has_many associations on unsaved records. Closes #9989 [hasmanyjosh]
2
75
 
3
76
  * Allow association redefinition in subclasses. #9346 [wildchild]
4
77
 
5
78
  * Fix has_many :through delete with custom foreign keys. #6466 [naffis]
6
79
 
80
+ * Foxy fixtures, from rathole (http://svn.geeksomnia.com/rathole/trunk/README)
81
+ - stable, autogenerated IDs
82
+ - specify associations (belongs_to, has_one, has_many) by label, not ID
83
+ - specify HABTM associations as inline lists
84
+ - autofill timestamp columns
85
+ - support YAML defaults
86
+ - fixture label interpolation
87
+ Enabled for fixtures that correspond to a model class and don't specify a primary key value. #9981 [jbarnette]
88
+
89
+ * Add docs explaining how to protect all attributes using attr_accessible with no arguments. Closes #9631 [boone, rmm5t]
90
+
91
+ * Update add_index documentation to use new options api. Closes #9787 [kamal]
92
+
93
+ * Allow find on a has_many association defined with :finder_sql to accept id arguments as strings like regular find does. Closes #9916 [krishna]
94
+
95
+ * Use VALID_FIND_OPTIONS when resolving :find scoping rather than hard coding the list of valid find options. Closes #9443 [sur]
96
+
97
+ * Limited eager loading no longer ignores scoped :order. Closes #9561 [danger, josh]
98
+
99
+ * Assigning an instance of a foreign class to a composed_of aggregate calls an optional conversion block. Refactor and simplify composed_of implementation. #6322 [brandon, Chris Cruft]
100
+
101
+ * Assigning nil to a composed_of aggregate also sets its immediate value to nil. #9843 [Chris Cruft]
102
+
103
+ * Ensure that mysql quotes table names with database names correctly. Closes #9911 [crayz]
104
+
105
+ "foo.bar" => "`foo`.`bar`"
106
+
107
+ * Complete the assimilation of Sexy Migrations from ErrFree [Chris Wanstrath, PJ Hyett]
108
+ http://errtheblog.com/post/2381
109
+
110
+ * Qualified column names work in hash conditions, like :conditions => { 'comments.created_at' => ... }. #9733 [danger]
111
+
7
112
  * Fix regression where the association would not construct new finder SQL on save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. #8713 [Bryan Helmkamp]
8
113
 
114
+ * Refactor association create and build so before & after callbacks behave consistently. #8854 [lifofifo, mortent]
115
+
116
+ * Quote table names. Defaults to column quoting. #4593 [Justin Lynn, gwcoffey, eadz, Dmitry V. Sabanin, Jeremy Kemper]
117
+
118
+ * Alias association #build to #new so it behaves predictably. #8787 [lifofifo]
119
+
120
+ * Add notes to documentation regarding attr_readonly behavior with counter caches and polymorphic associations. Closes #9835 [saimonmoore, rick]
121
+
122
+ * Observers can observe model names as symbols properly now. Closes #9869 [queso]
123
+
124
+ * find_and_(initialize|create)_by methods can now properly initialize protected attributes [Tobias Luetke]
125
+
126
+ * belongs_to infers the foreign key from the association name instead of from the class name. [Jeremy Kemper]
127
+
128
+ * PostgreSQL: support multiline default values. #7533 [Carl Lerche, aguynamedryan, Rein Henrichs, Tarmo Tänav]
129
+
130
+ * MySQL: fix change_column on not-null columns that don't accept dfeault values of ''. #6663 [Jonathan Viney, Tarmo Tänav]
131
+
132
+ * validates_uniqueness_of behaves well with abstract superclasses and
133
+ single-table inheritance. #3833, #9886 [Gabriel Gironda, rramdas, François Beausoleil, Josh Peek, Tarmo Tänav, pat]
134
+
135
+ * Warn about protected attribute assigments in development and test environments when mass-assigning to an attr_protected attribute. #9802 [Henrik N]
136
+
137
+ * Speedup database date/time parsing. [Jeremy Kemper, Tarmo Tänav]
138
+
139
+ * Fix calling .clear on a has_many :dependent=>:delete_all association. [tarmo]
140
+
141
+ * Allow change_column to set NOT NULL in the PostgreSQL adapter [tarmo]
142
+
143
+ * Fix that ActiveRecord would create attribute methods and override custom attribute getters if the method is also defined in Kernel.methods. [Rick]
144
+
145
+ * Don't call attr_readonly on polymorphic belongs_to associations, in case it matches the name of some other non-ActiveRecord class/module. [Rick]
146
+
147
+ * Try loading activerecord-<adaptername>-adapter gem before trying a plain require so you can use custom gems for the bundled adapters. Also stops gems from requiring an adapter from an old Active Record gem. [Jeremy Kemper, Derrick Spell]
148
+
9
149
 
10
- *1.15.5* (October 12th, 2007)
150
+ *2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.14.2 - 1.15.3]
11
151
 
12
- * Depend on Action Pack 1.4.4
152
+ * Add attr_readonly to specify columns that are skipped during a normal ActiveRecord #save operation. Closes #6896 [dcmanges]
13
153
 
154
+ class Comment < ActiveRecord::Base
155
+ # Automatically sets Article#comments_count as readonly.
156
+ belongs_to :article, :counter_cache => :comments_count
157
+ end
14
158
 
15
- *1.15.4* (October 4th, 2007)
159
+ class Article < ActiveRecord::Base
160
+ attr_readonly :approved_comments_count
161
+ end
16
162
 
17
- * Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [lifofifo]
163
+ * Make size for has_many :through use counter cache if it exists. Closes #9734 [xaviershay]
164
+
165
+ * Remove DB2 adapter since IBM chooses to maintain their own adapter instead. [Jeremy Kemper]
166
+
167
+ * Extract Oracle, SQLServer, and Sybase adapters into gems. [Jeremy Kemper]
168
+
169
+ * Added fixture caching that'll speed up a normal fixture-powered test suite between 50% and 100% #9682 [frederick.cheung@gmail.com]
170
+
171
+ * Correctly quote id list for limited eager loading. #7482 [tmacedo]
172
+
173
+ * Fixed that using version-targetted migrates would fail on loggers other than the default one #7430 [valeksenko]
174
+
175
+ * Fixed rename_column for SQLite when using symbols for the column names #8616 [drodriguez]
176
+
177
+ * Added the possibility of using symbols in addition to concrete classes with ActiveRecord::Observer#observe #3998 [robbyrussell/tarmo]
178
+
179
+ * Added ActiveRecord::Base#to_json/from_json [DHH/chuyeow]
180
+
181
+ * Added ActiveRecord::Base#from_xml [DHH]. Example:
182
+
183
+ xml = "<person><name>David</name></person>"
184
+ Person.new.from_xml(xml).name # => "David"
185
+
186
+ * Define dynamic finders as real methods after first usage. [bscofield]
187
+
188
+ * Deprecation: remove deprecated threaded_connections methods. Use allow_concurrency instead. [Jeremy Kemper]
189
+
190
+ * Associations macros accept extension blocks alongside modules. #9346 [Josh Peek]
191
+
192
+ * Speed up and simplify query caching. [Jeremy Kemper]
193
+
194
+ * connection.select_rows 'sql' returns an array (rows) of arrays (field values). #2329 [Michael Schuerig]
195
+
196
+ * Eager loading respects explicit :joins. #9496 [dasil003]
197
+
198
+ * Extract Firebird, FrontBase, and OpenBase adapters into gems. #9508, #9509, #9510 [Jeremy Kemper]
199
+
200
+ * RubyGem database adapters: expects a gem named activerecord-<database>-adapter with active_record/connection_adapters/<database>_adapter.rb in its load path. [Jeremy Kemper]
201
+
202
+ * Fixed that altering join tables in migrations would fail w/ sqlite3 #7453 [TimoMihaljov/brandon]
203
+
204
+ * Fix association writer with :dependent => :nullify. #7314 [Jonathan Viney]
205
+
206
+ * OpenBase: update for new lib and latest Rails. Support migrations. #8748 [dcsesq]
207
+
208
+ * Moved acts_as_tree into a plugin of the same name on the official Rails svn #9514 [lifofifo]
209
+
210
+ * Moved acts_as_nested_set into a plugin of the same name on the official Rails svn #9516 [josh]
211
+
212
+ * Moved acts_as_list into a plugin of the same name on the official Rails svn [josh]
213
+
214
+ * Explicitly require active_record/query_cache before using it. [Jeremy Kemper]
215
+
216
+ * Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record. [Rick, marclove]
217
+
218
+ * Performance: absorb instantiate and initialize_with_callbacks into the Base methods. [Jeremy Kemper]
219
+
220
+ * Fixed that eager loading queries and with_scope should respect the :group option [DHH]
221
+
222
+ * Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]
223
+
224
+ For more information see: http://dev.rubyonrails.org/ticket/8049
18
225
 
19
226
  * Don't clobber includes passed to has_many.count [danger]
20
227
 
21
228
  * Make sure has_many uses :include when counting [danger]
22
229
 
230
+ * Change the implementation of ActiveRecord's attribute reader and writer methods [nzkoz]
231
+ - Generate Reader and Writer methods which cache attribute values in hashes. This is to avoid repeatedly parsing the same date or integer columns.
232
+ - Change exception raised when users use find with :select then try to access a skipped column. Plugins could override missing_attribute() to lazily load the columns.
233
+ - Move method definition to the class, instead of the instance
234
+ - Always generate the readers, writers and predicate methods.
235
+
236
+ * Perform a deep #dup on query cache results so that modifying activerecord attributes does not modify the cached attributes. [Rick]
237
+
238
+ # Ensure that has_many :through associations use a count query instead of loading the target when #size is called. Closes #8800 [lifo]
239
+
240
+ * Added :unless clause to validations #8003 [monki]. Example:
241
+
242
+ def using_open_id?
243
+ !identity_url.blank?
244
+ end
245
+
246
+ validates_presence_of :identity_url, :if => using_open_id?
247
+ validates_presence_of :username, :unless => using_open_id?
248
+ validates_presence_of :password, :unless => using_open_id?
249
+
250
+ * Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [lifofifo]
251
+
252
+ * Fix and properly document/test count(column_name) usage. Closes #8999 [lifofifo]
253
+
254
+ * Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 [lifofifo]
255
+
256
+ * Change belongs_to so that the foreign_key assumption is taken from the association name, not the class name. Closes #8992 [hasmanyjosh]
257
+
258
+ OLD
259
+ belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is user_id
260
+
261
+ NEW
262
+ belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is visitor_id
263
+
264
+ * Remove spurious tests from deprecated_associations_test, most of these aren't deprecated, and are duplicated in associations_test. Closes #8987 [lifofifo]
265
+
266
+ * Make create! on a has_many :through association return the association object. Not the collection. Closes #8786 [lifofifo]
267
+
268
+ * Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003]
269
+
270
+ * Don't call unsupported methods on associated objects when using :include, :method with to_xml #7307, [manfred, jwilger]
271
+
272
+ * Define collection singular ids method for has_many :through associations. #8763 [lifofifo]
273
+
274
+ * Array attribute conditions work with proxied association collections. #8318 [kamal, theamazingrando]
275
+
276
+ * Fix polymorphic has_one associations declared in an abstract class. #8638 [lifofifo, daxhuiberts]
277
+
278
+ * Fixed validates_associated should not stop on the first error #4276 [mrj/manfred/josh]
279
+
280
+ * Rollback if commit raises an exception. #8642 [kik, Jeremy Kemper]
281
+
282
+ * Update tests' use of fixtures for the new collections api. #8726 [kamal]
283
+
23
284
  * Save associated records only if the association is already loaded. #8713 [blaine]
24
285
 
25
- * Changing the :default Date format doesn't break date quoting. #6312 [bshand, Elias]
286
+ * MySQL: fix show_variable. #8448 [matt, Jeremy Kemper]
287
+
288
+ * Fixtures: correctly delete and insert fixtures in a single transaction. #8553 [Michael Schuerig]
289
+
290
+ * Fixtures: people(:technomancy, :josh) returns both fixtures. #7880 [technomancy, Josh Peek]
291
+
292
+ * Calculations support non-numeric foreign keys. #8154 [kamal]
293
+
294
+ * with_scope is protected. #8524 [Josh Peek]
295
+
296
+ * Quickref for association methods. #7723 [marclove, Mindsweeper]
297
+
298
+ * Calculations: return nil average instead of 0 when there are no rows to average. #8298 [davidw]
299
+
300
+ * acts_as_nested_set: direct_children is sorted correctly. #4761 [Josh Peek, rails@33lc0.net]
301
+
302
+ * Raise an exception if both attr_protected and attr_accessible are declared. #8507 [stellsmi]
303
+
304
+ * SQLite, MySQL, PostgreSQL, Oracle: quote column names in column migration SQL statements. #8466 [marclove, lorenjohnson]
305
+
306
+ * Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
307
+
308
+ * Oracle: support binary fixtures. #7987 [Michael Schoen]
26
309
 
27
- * Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
310
+ * Fixtures: pull fixture insertion into the database adapters. #7987 [Michael Schoen]
311
+
312
+ * Announce migration versions as they're performed. [Jeremy Kemper]
313
+
314
+ * find gracefully copes with blank :conditions. #7599 [Dan Manges, johnnyb]
315
+
316
+ * validates_numericality_of takes :greater_than, :greater_than_or_equal_to, :equal_to, :less_than, :less_than_or_equal_to, :odd, and :even options. #3952 [Bob Silva, Dan Kubb, Josh Peek]
317
+
318
+ * MySQL: create_database takes :charset and :collation options. Charset defaults to utf8. #8448 [matt]
319
+
320
+ * Find with a list of ids supports limit/offset. #8437 [hrudududu]
321
+
322
+ * Optimistic locking: revert the lock version when an update fails. #7840 [plang]
323
+
324
+ * Migrations: add_column supports custom column types. #7742 [jsgarvin, Theory]
325
+
326
+ * Load database adapters on demand. Eliminates config.connection_adapters and RAILS_CONNECTION_ADAPTERS. Add your lib directory to the $LOAD_PATH and put your custom adapter in lib/active_record/connection_adapters/adaptername_adapter.rb. This way you can provide custom adapters as plugins or gems without modifying Rails. [Jeremy Kemper]
327
+
328
+ * Ensure that associations with :dependent => :delete_all respect :conditions option. Closes #8034 [danger, joshpeek, Rick]
28
329
 
29
330
  * belongs_to assignment creates a new proxy rather than modifying its target in-place. #8412 [mmangino@elevatedrails.com]
30
331
 
@@ -32,56 +333,152 @@
32
333
 
33
334
  * Document deep eager includes. #6267 [Josh Susser, Dan Manges]
34
335
 
336
+ * Document warning that associations names shouldn't be reserved words. #4378 [murphy@cYcnus.de, Josh Susser]
337
+
338
+ * Sanitize Base#inspect. #8392, #8623 [Nik Wakelin, jnoon]
339
+
340
+ * Replace the transaction {|transaction|..} semantics with a new Exception ActiveRecord::Rollback. [Koz]
341
+
35
342
  * Oracle: extract column length for CHAR also. #7866 [ymendel]
36
343
 
344
+ * Document :allow_nil option for validates_acceptance_of since it defaults to true. [tzaharia]
345
+
346
+ * Update documentation for :dependent declaration so that it explicitly uses the non-deprecated API. [danger]
347
+
348
+ * Add documentation caveat about when to use count_by_sql. [fearoffish]
349
+
350
+ * Enhance documentation for increment_counter and decrement_counter. [fearoffish]
351
+
352
+ * Provide brief introduction to what optimistic locking is. [fearoffish]
353
+
354
+ * Add documentation for :encoding option to mysql adapter. [marclove]
355
+
356
+ * Added short-hand declaration style to migrations (inspiration from Sexy Migrations, http://errtheblog.com/post/2381) [DHH]. Example:
357
+
358
+ create_table "products" do |t|
359
+ t.column "shop_id", :integer
360
+ t.column "creator_id", :integer
361
+ t.column "name", :string, :default => "Untitled"
362
+ t.column "value", :string, :default => "Untitled"
363
+ t.column "created_at", :datetime
364
+ t.column "updated_at", :datetime
365
+ end
366
+
367
+ ...can now be written as:
368
+
369
+ create_table :products do |t|
370
+ t.integer :shop_id, :creator_id
371
+ t.string :name, :value, :default => "Untitled"
372
+ t.timestamps
373
+ end
374
+
375
+ * Use association name for the wrapper element when using .to_xml. Previous behavior lead to non-deterministic situations with STI and polymorphic associations. [Koz, jstrachan]
376
+
377
+ * Improve performance of calling .create on has_many :through associations. [evan]
378
+
379
+ * Improved cloning performance by relying less on exception raising #8159 [Blaine]
380
+
381
+ * Added ActiveRecord::Base.inspect to return a column-view like #<Post id:integer, title:string, body:text> [DHH]
382
+
383
+ * Added yielding of Builder instance for ActiveRecord::Base#to_xml calls [DHH]
384
+
37
385
  * Small additions and fixes for ActiveRecord documentation. Closes #7342 [jeremymcanally]
38
386
 
387
+ * Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925. [court3nay]
388
+
39
389
  * SQLite: binary escaping works with $KCODE='u'. #7862 [tsuka]
40
390
 
41
- * Improved cloning performance by relying less on exception raising #8159 [Blaine]
391
+ * Base#to_xml supports serialized attributes. #7502 [jonathan]
42
392
 
393
+ * Base.update_all :order and :limit options. Useful for MySQL updates that must be ordered to avoid violating unique constraints. [Jeremy Kemper]
43
394
 
44
- *1.15.3* (March 12th, 2007)
395
+ * Remove deprecated object transactions. People relying on this functionality should install the object_transactions plugin at http://code.bitsweat.net/svn/object_transactions. Closes #5637 [Koz, Jeremy Kemper]
45
396
 
46
- * Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
397
+ * PostgreSQL: remove DateTime -> Time downcast. Warning: do not enable translate_results for the C bindings if you have timestamps outside Time's domain. [Jeremy Kemper]
398
+
399
+ * find_or_create_by_* takes a hash so you can create with more attributes than are in the method name. For example, Person.find_or_create_by_name(:name => 'Henry', :comments => 'Hi new user!') is equivalent to Person.find_by_name('Henry') || Person.create(:name => 'Henry', :comments => 'Hi new user!'). #7368 [Josh Susser]
400
+
401
+ * Make sure with_scope takes both :select and :joins into account when setting :readonly. Allows you to save records you retrieve using method_missing on a has_many :through associations. [Koz]
402
+
403
+ * Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
404
+
405
+ * Consistent public/protected/private visibility for chained methods. #7813 [Dan Manges]
406
+
407
+ * Oracle: fix quoted primary keys and datetime overflow. #7798 [Michael Schoen]
47
408
 
48
409
  * Consistently quote primary key column names. #7763 [toolmantim]
49
410
 
50
411
  * Fixtures: fix YAML ordered map support. #2665 [Manuel Holtgrewe, nfbuckley]
51
412
 
413
+ * DateTimes assume the default timezone. #7764 [Geoff Buesing]
414
+
415
+ * Sybase: hide timestamp columns since they're inherently read-only. #7716 [Mike Joyce]
416
+
417
+ * Oracle: overflow Time to DateTime. #7718 [Michael Schoen]
418
+
419
+ * PostgreSQL: don't use async_exec and async_query with postgres-pr. #7727, #7762 [flowdelic, toolmantim]
420
+
52
421
  * Fix has_many :through << with custom foreign keys. #6466, #7153 [naffis, Rich Collins]
53
422
 
423
+ * Test DateTime native type in migrations, including an edge case with dates
424
+ during calendar reform. #7649, #7724 [fedot, Geoff Buesing]
54
425
 
55
- *1.15.2* (February 5th, 2007)
426
+ * SQLServer: correctly schema-dump tables with no indexes or descending indexes. #7333, #7703 [Jakob S, Tom Ward]
56
427
 
57
- * Pass a range in :conditions to use the SQL BETWEEN operator. #6974 [dcmanges]
58
- Student.find(:all, :conditions => { :grade => 9..12 })
428
+ * SQLServer: recognize real column type as Ruby float. #7057 [sethladd, Tom Ward]
59
429
 
60
- * Don't create instance writer methods for class attributes. [Rick]
430
+ * Added fixtures :all as a way of loading all fixtures in the fixture directory at once #7214 [manfred]
431
+
432
+ * Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]. Example:
433
+
434
+ transaction do |transaction|
435
+ david.withdrawal(100)
436
+ mary.deposit(100)
437
+ transaction.rollback! # rolls back the transaction that was otherwise going to be successful
438
+ end
61
439
 
440
+ * Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method [Jamis Buck]
441
+
442
+ * Reworked David's query cache to be available as Model.cache {...}. For the duration of the block no select query should be run more then once. Any inserts/deletes/executes will flush the whole cache however [Tobias Luetke]
443
+ Task.cache { Task.find(1); Task.find(1) } #=> 1 query
444
+
62
445
  * When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck]
63
446
 
447
+ * Oracle: fix lob and text default handling. #7344 [gfriedrich, Michael Schoen]
448
+
64
449
  * SQLServer: don't choke on strings containing 'null'. #7083 [Jakob S]
65
450
 
66
- * Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. #6495 [Si]
451
+ * MySQL: blob and text columns may not have defaults in 5.x. Update fixtures schema for strict mode. #6695 [Dan Kubb]
452
+
453
+ * update_all can take a Hash argument. sanitize_sql splits into two methods for conditions and assignment since NULL values and delimiters are handled differently. #6583, #7365 [sandofsky, Assaf]
67
454
 
68
455
  * MySQL: SET SQL_AUTO_IS_NULL=0 so 'where id is null' doesn't select the last inserted id. #6778 [Jonathan Viney, timc]
69
456
 
457
+ * Use Date#to_s(:db) for quoted dates. #7411 [Michael Schoen]
458
+
459
+ * Don't create instance writer methods for class attributes. Closes #7401 [Rick]
460
+
461
+ * Docs: validations examples. #7343 [zackchandler]
462
+
463
+ * Add missing tests ensuring callbacks work with class inheritance. Closes #7339 [sandofsky]
464
+
70
465
  * Fixtures use the table name and connection from set_fixture_class. #7330 [Anthony Eden]
71
466
 
72
- * SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
467
+ * Remove useless code in #attribute_present? since 0 != blank?. Closes #7249 [Josh Susser]
73
468
 
469
+ * Fix minor doc typos. Closes #7157 [Josh Susser]
74
470
 
75
- *1.15.1* (January 17th, 2007)
471
+ * Fix incorrect usage of #classify when creating the eager loading join statement. Closes #7044 [Josh Susser]
76
472
 
77
- * Fix nodoc breaking of adapters
473
+ * SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
78
474
 
475
+ * Subclasses of an abstract class work with single-table inheritance. #5704, #7284 [BertG, nick+rails@ag.arizona.edu]
79
476
 
80
- *1.15.0* (January 16th, 2007)
477
+ * Make sure sqlite3 driver closes open connections on disconnect [Rob Rasmussen]
81
478
 
82
479
  * [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
83
480
 
84
- * change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [dcmanges, Jeremy Kemper]
481
+ * change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [Dan Manges, Jeremy Kemper]
85
482
 
86
483
  * MySQL, PostgreSQL: change_column_default quotes the default value and doesn't lose column type information. #3987, #6664 [Jonathan Viney, manfred, altano@bigfoot.com]
87
484
 
@@ -89,12 +486,17 @@
89
486
 
90
487
  * MySQL: retain SSL settings on reconnect. #6976 [randyv2]
91
488
 
489
+ * Apply scoping during initialize instead of create. Fixes setting of foreign key when using find_or_initialize_by with scoping. [Cody Fauser]
490
+
92
491
  * SQLServer: handle [quoted] table names. #6635 [rrich]
93
492
 
94
493
  * acts_as_nested_set works with single-table inheritance. #6030 [Josh Susser]
95
494
 
96
495
  * PostgreSQL, Oracle: correctly perform eager finds with :limit and :order. #4668, #7021 [eventualbuddha, Michael Schoen]
97
496
 
497
+ * Pass a range in :conditions to use the SQL BETWEEN operator. #6974 [Dan Manges]
498
+ Student.find(:all, :conditions => { :grade => 9..12 })
499
+
98
500
  * Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
99
501
 
100
502
  * [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
@@ -103,36 +505,68 @@
103
505
 
104
506
  * Bring the sybase adapter up to scratch for 1.2 release. [jsheets]
105
507
 
508
+ * Rollback new_record? and id when an exception is raised in a save callback. #6910 [Ben Curren, outerim]
509
+
510
+ * Pushing a record on an association collection doesn't unnecessarily load all the associated records. [Obie Fernandez, Jeremy Kemper]
511
+
106
512
  * Oracle: fix connection reset failure. #6846 [leonlleslie]
107
513
 
108
514
  * Subclass instantiation doesn't try to explicitly require the corresponding subclass. #6840 [leei, Jeremy Kemper]
109
515
 
110
516
  * fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
111
517
 
518
+ * Consolidated different create and create! versions to call through to the base class with scope. This fixes inconsistencies, especially related to protected attribtues. Closes #5847 [Alexander Dymo, Tobias Luetke]
519
+
112
520
  * find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. #6764 [vitaly, Jeremy Kemper]
113
521
 
114
- * Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
115
- find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }
522
+ * Add AssociationCollection#create! to be consistent with AssociationCollection#create when dealing with a foreign key that is a protected attribute [Cody Fauser]
523
+
524
+ * Added counter optimization for AssociationCollection#any? so person.friends.any? won't actually load the full association if we have the count in a cheaper form [DHH]
525
+
526
+ * Change fixture_path to a class inheritable accessor allowing test cases to have their own custom set of fixtures. #6672 [zdennis]
116
527
 
117
528
  * Quote ActiveSupport::Multibyte::Chars. #6653 [Julian Tarkhanov]
118
529
 
119
- * MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. #6156 [simon@redhillconsulting.com.au, obrie, Jonathan Viney, Jeremy Kemper]
530
+ * Simplify query_attribute by typecasting the attribute value and checking whether it's nil, false, zero or blank. #6659 [Jonathan Viney]
120
531
 
121
532
  * validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. #5716 [Andreas Schwarz]
122
533
 
534
+ * Run validations in the order they were declared. #6657 [obrie]
535
+
536
+ * MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. #6156 [simon@redhillconsulting.com.au, obrie, Jonathan Viney, Jeremy Kemper]
537
+
538
+ * Simplify association proxy implementation by factoring construct_scope out of method_missing. #6643 [martin]
539
+
123
540
  * Oracle: automatically detect the primary key. #6594 [vesaria, Michael Schoen]
124
541
 
125
542
  * Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. #6607 [philbogle@gmail.com, ray.fortna@jobster.com, Michael Schoen]
126
543
 
544
+ * Don't inspect unloaded associations. #2905 [lmarlow]
545
+
546
+ * SQLite: use AUTOINCREMENT primary key in >= 3.1.0. #6588, #6616 [careo, lukfugl]
547
+
548
+ * Cache inheritance_column. #6592 [Stefan Kaes]
549
+
127
550
  * Firebird: decimal/numeric support. #6408 [macrnic]
128
551
 
552
+ * make add_order a tad faster. #6567 [Stefan Kaes]
553
+
129
554
  * Find with :include respects scoped :order. #5850
130
555
 
556
+ * Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
557
+ find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }
558
+
559
+ * Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. #6495 [Si]
560
+
561
+ * SQLite: fix calculations workaround, remove count(distinct) query rewrite, cleanup test connection scripts. [Jeremy Kemper]
562
+
563
+ * SQLite: count(distinct) queries supported in >= 3.2.6. #6544 [Bob Silva]
564
+
131
565
  * Dynamically generate reader methods for serialized attributes. #6362 [Stefan Kaes]
132
566
 
133
567
  * Deprecation: object transactions warning. [Jeremy Kemper]
134
568
 
135
- * has_one :dependent => :nullify ignores nil associates. #6528 [janovetz, Jeremy Kemper]
569
+ * has_one :dependent => :nullify ignores nil associates. #4848, #6528 [bellis@deepthought.org, janovetz, Jeremy Kemper]
136
570
 
137
571
  * Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults, fix limited id selection for eager loading. Factor out some common methods from all adapters. #6515 [Michael Schoen]
138
572
 
@@ -194,12 +628,20 @@
194
628
 
195
629
  * Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true. #6024 [Josh Susser]
196
630
 
631
+ * Document validates_presences_of behavior with booleans: you probably want validates_inclusion_of :attr, :in => [true, false]. #2253 [Bob Silva]
632
+
197
633
  * Optimistic locking: gracefully handle nil versions, treat as zero. #5908 [Tom Ward]
198
634
 
199
635
  * to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher]
200
636
 
637
+ * Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark]
638
+
639
+ * Add some XmlSerialization tests for ActiveRecord [Rick Olson]
640
+
201
641
  * has_many :through conditions are sanitized by the associating class. #5971 [martin.emde@gmail.com]
202
642
 
643
+ * Tighten rescue clauses. #5985 [james@grayproductions.net]
644
+
203
645
  * Fix spurious newlines and spaces in AR::Base#to_xml output [Jamis Buck]
204
646
 
205
647
  * has_one supports the :dependent => :delete option which skips the typical callback chain and deletes the associated object directly from the database. #5927 [Chris Mear, Jonathan Viney]
@@ -208,6 +650,8 @@
208
650
 
209
651
  * SQLServer: work around bug where some unambiguous date formats are not correctly identified if the session language is set to german. #5894 [Tom Ward, kruth@bfpi]
210
652
 
653
+ * SQLServer: fix eager association test. #5901 [Tom Ward]
654
+
211
655
  * Clashing type columns due to a sloppy join shouldn't wreck single-table inheritance. #5838 [Kevin Clark]
212
656
 
213
657
  * Fixtures: correct escaping of \n and \r. #5859 [evgeny.zislis@gmail.com]
@@ -258,12 +702,16 @@
258
702
 
259
703
  * Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
260
704
 
705
+ * Document find's :from option. Closes #5762. [andrew@redlinesoftware.com]
706
+
261
707
  * PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. #5280 [guy.naor@famundo.com]
262
708
 
263
709
  * Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
264
710
 
265
711
  * Cache nil results for has_one associations so multiple calls don't call the database. Closes #5757. [Michael A. Schoen]
266
712
 
713
+ * Add documentation for how to disable timestamps on a per model basis. Closes #5684. [matt@mattmargolis.net Marcel Molina Jr.]
714
+
267
715
  * Don't save has_one associations unnecessarily. #5735 [Jonathan Viney]
268
716
 
269
717
  * Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global observer resetting. [Rick Olson]
@@ -312,6 +760,8 @@
312
760
 
313
761
  * PostgreSQL: create/drop as postgres user. #4790 [mail@matthewpainter.co.uk, mlaster@metavillage.com]
314
762
 
763
+ * Update callbacks documentation. #3970 [Robby Russell <robby@planetargon.com>]
764
+
315
765
  * PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
316
766
 
317
767
  * PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
@@ -324,6 +774,8 @@
324
774
 
325
775
  * Added :group to available options for finds done on associations #5516 [mike@michaeldewey.org]
326
776
 
777
+ * Minor tweak to improve performance of ActiveRecord::Base#to_param.
778
+
327
779
  * Observers also watch subclasses created after they are declared. #5535 [daniels@pronto.com.au]
328
780
 
329
781
  * Removed deprecated timestamps_gmt class methods. [Jeremy Kemper]
@@ -423,10 +875,22 @@
423
875
 
424
876
  * Allow AR::Base#to_xml to include methods too. Closes #4921. [johan@textdrive.com]
425
877
 
878
+ * Replace superfluous name_to_class_name variant with camelize. [Marcel Molina Jr.]
879
+
880
+ * Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
881
+
882
+ * Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
883
+
426
884
  * Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac <blair@orcaware.com>]
427
885
 
886
+ * Update FrontBase adapter to check binding version. Closes #4920. [mlaster@metavillage.com]
887
+
888
+ * New Frontbase connections don't start in auto-commit mode. Closes #4922. [mlaster@metavillage.com]
889
+
428
890
  * When grouping, use the appropriate option key. [Marcel Molina Jr.]
429
891
 
892
+ * Only modify the sequence name in the FrontBase adapter if the FrontBase adapter is actually being used. [Marcel Molina Jr.]
893
+
430
894
  * Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
431
895
 
432
896
  * Add warning about the proper way to validate the presence of a foreign key. Closes #4147. [Francois Beausoleil <francois.beausoleil@gmail.com>]
@@ -454,6 +918,8 @@
454
918
 
455
919
  * Allow all calculations to take the :include option, not just COUNT (closes #4840) [Rick]
456
920
 
921
+ * Update inconsistent migrations documentation. #4683 [machomagna@gmail.com]
922
+
457
923
  * Add ActiveRecord::Errors#to_xml [Jamis Buck]
458
924
 
459
925
  * Properly quote index names in migrations (closes #4764) [John Long]
@@ -464,6 +930,10 @@
464
930
 
465
931
  * Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
466
932
 
933
+ * DRY up association collection reader method generation. [Marcel Molina Jr.]
934
+
935
+ * DRY up and tweak style of the validation error object. [Marcel Molina Jr.]
936
+
467
937
  * Add :case_sensitive option to validates_uniqueness_of (closes #3090) [Rick]
468
938
 
469
939
  class Account < ActiveRecord::Base
@@ -476,27 +946,462 @@
476
946
  has_many :people, :extend => [FindOrCreateByNameExtension, FindRecentExtension]
477
947
  end
478
948
 
949
+ *1.15.3* (March 12th, 2007)
479
950
 
480
- *1.14.4* (August 8th, 2006)
951
+ * Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
481
952
 
482
- * Add warning about the proper way to validate the presence of a foreign key. #4147 [Francois Beausoleil <francois.beausoleil@gmail.com>]
953
+ * Consistently quote primary key column names. #7763 [toolmantim]
483
954
 
484
- * Fix syntax error in documentation. #4679 [mislav@nippur.irb.hr]
955
+ * Fixtures: fix YAML ordered map support. #2665 [Manuel Holtgrewe, nfbuckley]
485
956
 
486
- * Update inconsistent migrations documentation. #4683 [machomagna@gmail.com]
957
+ * Fix has_many :through << with custom foreign keys. #6466, #7153 [naffis, Rich Collins]
487
958
 
488
959
 
489
- *1.14.3* (June 27th, 2006)
960
+ *1.15.2* (February 5th, 2007)
490
961
 
491
- * Fix announcement of very long migration names. #5722 [blake@near-time.com]
962
+ * Pass a range in :conditions to use the SQL BETWEEN operator. #6974 [dcmanges]
963
+ Student.find(:all, :conditions => { :grade => 9..12 })
492
964
 
493
- * Update callbacks documentation. #3970 [Robby Russell <robby@planetargon.com>]
965
+ * Don't create instance writer methods for class attributes. [Rick]
494
966
 
495
- * Properly quote index names in migrations (closes #4764) [John Long]
967
+ * When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck]
496
968
 
497
- * Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
969
+ * SQLServer: don't choke on strings containing 'null'. #7083 [Jakob S]
498
970
 
499
- * Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
971
+ * Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. #6495 [Si]
972
+
973
+ * MySQL: SET SQL_AUTO_IS_NULL=0 so 'where id is null' doesn't select the last inserted id. #6778 [Jonathan Viney, timc]
974
+
975
+ * Fixtures use the table name and connection from set_fixture_class. #7330 [Anthony Eden]
976
+
977
+ * SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
978
+
979
+
980
+ *1.15.1* (January 17th, 2007)
981
+
982
+ * Fix nodoc breaking of adapters
983
+
984
+
985
+ *1.15.0* (January 16th, 2007)
986
+
987
+ * [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
988
+
989
+ * change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [dcmanges, Jeremy Kemper]
990
+
991
+ * MySQL, PostgreSQL: change_column_default quotes the default value and doesn't lose column type information. #3987, #6664 [Jonathan Viney, manfred, altano@bigfoot.com]
992
+
993
+ * Oracle: create_table takes a :sequence_name option to override the 'tablename_seq' default. #7000 [Michael Schoen]
994
+
995
+ * MySQL: retain SSL settings on reconnect. #6976 [randyv2]
996
+
997
+ * SQLServer: handle [quoted] table names. #6635 [rrich]
998
+
999
+ * acts_as_nested_set works with single-table inheritance. #6030 [Josh Susser]
1000
+
1001
+ * PostgreSQL, Oracle: correctly perform eager finds with :limit and :order. #4668, #7021 [eventualbuddha, Michael Schoen]
1002
+
1003
+ * Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
1004
+
1005
+ * [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
1006
+
1007
+ * [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot]
1008
+
1009
+ * Bring the sybase adapter up to scratch for 1.2 release. [jsheets]
1010
+
1011
+ * Oracle: fix connection reset failure. #6846 [leonlleslie]
1012
+
1013
+ * Subclass instantiation doesn't try to explicitly require the corresponding subclass. #6840 [leei, Jeremy Kemper]
1014
+
1015
+ * fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
1016
+
1017
+ * find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. #6764 [vitaly, Jeremy Kemper]
1018
+
1019
+ * Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
1020
+ find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }
1021
+
1022
+ * Quote ActiveSupport::Multibyte::Chars. #6653 [Julian Tarkhanov]
1023
+
1024
+ * MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. #6156 [simon@redhillconsulting.com.au, obrie, Jonathan Viney, Jeremy Kemper]
1025
+
1026
+ * validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. #5716 [Andreas Schwarz]
1027
+
1028
+ * Oracle: automatically detect the primary key. #6594 [vesaria, Michael Schoen]
1029
+
1030
+ * Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. #6607 [philbogle@gmail.com, ray.fortna@jobster.com, Michael Schoen]
1031
+
1032
+ * Firebird: decimal/numeric support. #6408 [macrnic]
1033
+
1034
+ * Find with :include respects scoped :order. #5850
1035
+
1036
+ * Dynamically generate reader methods for serialized attributes. #6362 [Stefan Kaes]
1037
+
1038
+ * Deprecation: object transactions warning. [Jeremy Kemper]
1039
+
1040
+ * has_one :dependent => :nullify ignores nil associates. #6528 [janovetz, Jeremy Kemper]
1041
+
1042
+ * Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults, fix limited id selection for eager loading. Factor out some common methods from all adapters. #6515 [Michael Schoen]
1043
+
1044
+ * Make add_column use the options hash with the Sqlite Adapter. Closes #6464 [obrie]
1045
+
1046
+ * Document other options available to migration's add_column. #6419 [grg]
1047
+
1048
+ * MySQL: all_hashes compatibility with old MysqlRes class. #6429, #6601 [Jeremy Kemper]
1049
+
1050
+ * Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
1051
+
1052
+ * fix select_limited_ids_list issues in postgresql, retain current behavior in other adapters [Rick]
1053
+
1054
+ * Restore eager condition interpolation, document it's differences [Rick]
1055
+
1056
+ * Don't rollback in teardown unless a transaction was started. Don't start a transaction in create_fixtures if a transaction is started. #6282 [Jacob Fugal, Jeremy Kemper]
1057
+
1058
+ * Add #delete support to has_many :through associations. Closes #6049 [Martin Landers]
1059
+
1060
+ * Reverted old select_limited_ids_list postgresql fix that caused issues in mysql. Closes #5851 [Rick]
1061
+
1062
+ * Removes the ability for eager loaded conditions to be interpolated, since there is no model instance to use as a context for interpolation. #5553 [turnip@turnipspatch.com]
1063
+
1064
+ * Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception #6126 [wreese@gmail.com]
1065
+
1066
+ * Added update_attributes! which uses save! to raise an exception if a validation error prevents saving #6192 [jonathan]
1067
+
1068
+ * Deprecated add_on_boundary_breaking (use validates_length_of instead) #6292 [BobSilva]
1069
+
1070
+ * The has_many create method works with polymorphic associations. #6361 [Dan Peterson]
1071
+
1072
+ * MySQL: introduce Mysql::Result#all_hashes to support further optimization. #5581 [Stefan Kaes]
1073
+
1074
+ * save! shouldn't validate twice. #6324 [maiha, Bob Silva]
1075
+
1076
+ * Association collections have an _ids reader method to match the existing writer for collection_select convenience (e.g. employee.task_ids). The writer method skips blank ids so you can safely do @employee.task_ids = params[:tasks] without checking every time for an empty list or blank values. #1887, #5780 [Michael Schuerig]
1077
+
1078
+ * Add an attribute reader method for ActiveRecord::Base.observers [Rick Olson]
1079
+
1080
+ * Deprecation: count class method should be called with an options hash rather than two args for conditions and joins. #6287 [Bob Silva]
1081
+
1082
+ * has_one associations with a nil target may be safely marshaled. #6279 [norbauer, Jeremy Kemper]
1083
+
1084
+ * Duplicate the hash provided to AR::Base#to_xml to prevent unexpected side effects [Koz]
1085
+
1086
+ * Add a :namespace option to AR::Base#to_xml [Koz]
1087
+
1088
+ * Deprecation tests. Remove warnings for dynamic finders and for the foo_count method if it's also an attribute. [Jeremy Kemper]
1089
+
1090
+ * Mock Time.now for more accurate Touch mixin tests. #6213 [Dan Peterson]
1091
+
1092
+ * Improve yaml fixtures error reporting. #6205 [Bruce Williams]
1093
+
1094
+ * Rename AR::Base#quote so people can use that name in their models. #3628 [Koz]
1095
+
1096
+ * Add deprecation warning for inferred foreign key. #6029 [Josh Susser]
1097
+
1098
+ * Fixed the Ruby/MySQL adapter we ship with Active Record to work with the new authentication handshake that was introduced in MySQL 4.1, along with the other protocol changes made at that time #5723 [jimw@mysql.com]
1099
+
1100
+ * Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true. #6024 [Josh Susser]
1101
+
1102
+ * Optimistic locking: gracefully handle nil versions, treat as zero. #5908 [Tom Ward]
1103
+
1104
+ * to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher]
1105
+
1106
+ * has_many :through conditions are sanitized by the associating class. #5971 [martin.emde@gmail.com]
1107
+
1108
+ * Fix spurious newlines and spaces in AR::Base#to_xml output [Jamis Buck]
1109
+
1110
+ * has_one supports the :dependent => :delete option which skips the typical callback chain and deletes the associated object directly from the database. #5927 [Chris Mear, Jonathan Viney]
1111
+
1112
+ * Nested subclasses are not prefixed with the parent class' table_name since they should always use the base class' table_name. #5911 [Jonathan Viney]
1113
+
1114
+ * SQLServer: work around bug where some unambiguous date formats are not correctly identified if the session language is set to german. #5894 [Tom Ward, kruth@bfpi]
1115
+
1116
+ * Clashing type columns due to a sloppy join shouldn't wreck single-table inheritance. #5838 [Kevin Clark]
1117
+
1118
+ * Fixtures: correct escaping of \n and \r. #5859 [evgeny.zislis@gmail.com]
1119
+
1120
+ * Migrations: gracefully handle missing migration files. #5857 [eli.gordon@gmail.com]
1121
+
1122
+ * MySQL: update test schema for MySQL 5 strict mode. #5861 [Tom Ward]
1123
+
1124
+ * to_xml: correct naming of included associations. #5831 [josh.starcher@gmail.com]
1125
+
1126
+ * Pushing a record onto a has_many :through sets the association's foreign key to the associate's primary key and adds it to the correct association. #5815, #5829 [josh@hasmanythrough.com]
1127
+
1128
+ * Add records to has_many :through using <<, push, and concat by creating the association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. [Jeremy Kemper]
1129
+
1130
+ # Create a tagging to associate the post and tag.
1131
+ post.tags << Tag.find_by_name('old')
1132
+ post.tags.create! :name => 'general'
1133
+
1134
+ # Would have been:
1135
+ post.taggings.create!(:tag => Tag.find_by_name('finally')
1136
+ transaction do
1137
+ post.taggings.create!(:tag => Tag.create!(:name => 'general'))
1138
+ end
1139
+
1140
+ * Cache nil results for :included has_one associations also. #5787 [Michael Schoen]
1141
+
1142
+ * Fixed a bug which would cause .save to fail after trying to access a empty has_one association on a unsaved record. [Tobias Luetke]
1143
+
1144
+ * Nested classes are given table names prefixed by the singular form of the parent's table name. [Jeremy Kemper]
1145
+ Example: Invoice::Lineitem is given table name invoice_lineitems
1146
+
1147
+ * Migrations: uniquely name multicolumn indexes so you don't have to. [Jeremy Kemper]
1148
+ # people_active_last_name_index, people_active_deactivated_at_index
1149
+ add_index :people, [:active, :last_name]
1150
+ add_index :people, [:active, :deactivated_at]
1151
+ remove_index :people, [:active, :last_name]
1152
+ remove_index :people, [:active, :deactivated_at]
1153
+
1154
+ WARNING: backward-incompatibility. Multicolumn indexes created before this
1155
+ revision were named using the first column name only. Now they're uniquely
1156
+ named using all indexed columns.
1157
+
1158
+ To remove an old multicolumn index, remove_index :table_name, :first_column
1159
+
1160
+ * Fix for deep includes on the same association. [richcollins@gmail.com]
1161
+
1162
+ * Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]
1163
+
1164
+ * Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
1165
+
1166
+ * PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. #5280 [guy.naor@famundo.com]
1167
+
1168
+ * Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
1169
+
1170
+ * Cache nil results for has_one associations so multiple calls don't call the database. Closes #5757. [Michael A. Schoen]
1171
+
1172
+ * Don't save has_one associations unnecessarily. #5735 [Jonathan Viney]
1173
+
1174
+ * Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global observer resetting. [Rick Olson]
1175
+
1176
+ * Formally deprecate the deprecated finders. [Koz]
1177
+
1178
+ * Formally deprecate rich associations. [Koz]
1179
+
1180
+ * Fixed that default timezones for new / initialize should uphold utc setting #5709 [daniluk@yahoo.com]
1181
+
1182
+ * Fix announcement of very long migration names. #5722 [blake@near-time.com]
1183
+
1184
+ * The exists? class method should treat a string argument as an id rather than as conditions. #5698 [jeremy@planetargon.com]
1185
+
1186
+ * Fixed to_xml with :include misbehaviors when invoked on array of model instances #5690 [alexkwolfe@gmail.com]
1187
+
1188
+ * Added support for conditions on Base.exists? #5689 [josh@joshpeek.com]. Examples:
1189
+
1190
+ assert (Topic.exists?(:author_name => "David"))
1191
+ assert (Topic.exists?(:author_name => "Mary", :approved => true))
1192
+ assert (Topic.exists?(["parent_id = ?", 1]))
1193
+
1194
+ * Schema dumper quotes date :default values. [Dave Thomas]
1195
+
1196
+ * Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan Peterson]
1197
+
1198
+ * Factor the attribute#{suffix} methods out of method_missing for easier extension. [Jeremy Kemper]
1199
+
1200
+ * Patch sql injection vulnerability when using integer or float columns. [Jamis Buck]
1201
+
1202
+ * Allow #count through a has_many association to accept :include. [Dan Peterson]
1203
+
1204
+ * create_table rdoc: suggest :id => false for habtm join tables. [Zed Shaw]
1205
+
1206
+ * PostgreSQL: return array fields as strings. #4664 [Robby Russell]
1207
+
1208
+ * SQLServer: added tests to ensure all database statements are closed, refactored identity_insert management code to use blocks, removed update/delete rowcount code out of execute and into update/delete, changed insert to go through execute method, removed unused quoting methods, disabled pessimistic locking tests as feature is currently unsupported, fixed RakeFile to load sqlserver specific tests whether running in ado or odbc mode, fixed support for recently added decimal types, added support for limits on integer types. #5670 [Tom Ward]
1209
+
1210
+ * SQLServer: fix db:schema:dump case-sensitivity. #4684 [Will Rogers]
1211
+
1212
+ * Oracle: BigDecimal support. #5667 [schoenm@earthlink.net]
1213
+
1214
+ * Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. #5454 [robbat2@gentoo.org, work@ashleymoran.me.uk]
1215
+
1216
+ * Firebird migrations support. #5337 [Ken Kunz <kennethkunz@gmail.com>]
1217
+
1218
+ * PostgreSQL: create/drop as postgres user. #4790 [mail@matthewpainter.co.uk, mlaster@metavillage.com]
1219
+
1220
+ * PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
1221
+
1222
+ * PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
1223
+
1224
+ * Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
1225
+
1226
+ * Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. #5635 [schoenm@earthlink.net]
1227
+
1228
+ * Fixed a few Oracle issues: Allows Oracle's odd date handling to still work consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net]
1229
+
1230
+ * Added :group to available options for finds done on associations #5516 [mike@michaeldewey.org]
1231
+
1232
+ * Observers also watch subclasses created after they are declared. #5535 [daniels@pronto.com.au]
1233
+
1234
+ * Removed deprecated timestamps_gmt class methods. [Jeremy Kemper]
1235
+
1236
+ * rake build_mysql_database grants permissions to rails@localhost. #5501 [brianegge@yahoo.com]
1237
+
1238
+ * PostgreSQL: support microsecond time resolution. #5492 [alex@msgpad.com]
1239
+
1240
+ * Add AssociationCollection#sum since the method_missing invokation has been shadowed by Enumerable#sum.
1241
+
1242
+ * Added find_or_initialize_by_X which works like find_or_create_by_X but doesn't save the newly instantiated record. [Sam Stephenson]
1243
+
1244
+ * Row locking. Provide a locking clause with the :lock finder option or true for the default "FOR UPDATE". Use the #lock! method to obtain a row lock on a single record (reloads the record with :lock => true). [Shugo Maeda]
1245
+ # Obtain an exclusive lock on person 1 so we can safely increment visits.
1246
+ Person.transaction do
1247
+ # select * from people where id=1 for update
1248
+ person = Person.find(1, :lock => true)
1249
+ person.visits += 1
1250
+ person.save!
1251
+ end
1252
+
1253
+ * PostgreSQL: introduce allow_concurrency option which determines whether to use blocking or asynchronous #execute. Adapters with blocking #execute will deadlock Ruby threads. The default value is ActiveRecord::Base.allow_concurrency. [Jeremy Kemper]
1254
+
1255
+ * Use a per-thread (rather than global) transaction mutex so you may execute concurrent transactions on separate connections. [Jeremy Kemper]
1256
+
1257
+ * Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320. [Nicholas Seckar]
1258
+
1259
+ * Use explicit delegation instead of method aliasing for AR::Base.to_param -> AR::Base.id. #5299 (skaes@web.de)
1260
+
1261
+ * Refactored ActiveRecord::Base.to_xml to become a delegate for XmlSerializer, which restores sanity to the mega method. This refactoring also reinstates the opinions that type="string" is redundant and ugly and nil-differentiation is not a concern of serialization [DHH]
1262
+
1263
+ * Added simple hash conditions to find that'll just convert hash to an AND-based condition string #5143 [hcatlin@gmail.com]. Example:
1264
+
1265
+ Person.find(:all, :conditions => { :last_name => "Catlin", :status => 1 }, :limit => 2)
1266
+
1267
+ ...is the same as:
1268
+
1269
+ Person.find(:all, :conditions => [ "last_name = ? and status = ?", "Catlin", 1 ], :limit => 2)
1270
+
1271
+ This makes it easier to pass in the options from a form or otherwise outside.
1272
+
1273
+
1274
+ * Fixed issues with BLOB limits, charsets, and booleans for Firebird #5194, #5191, #5189 [kennethkunz@gmail.com]
1275
+
1276
+ * Fixed usage of :limit and with_scope when the association in scope is a 1:m #5208 [alex@purefiction.net]
1277
+
1278
+ * Fixed migration trouble with SQLite when NOT NULL is used in the new definition #5215 [greg@lapcominc.com]
1279
+
1280
+ * Fixed problems with eager loading and counting on SQL Server #5212 [kajism@yahoo.com]
1281
+
1282
+ * Fixed that count distinct should use the selected column even when using :include #5251 [anna@wota.jp]
1283
+
1284
+ * Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses #5253 [alex@purefiction.net]
1285
+
1286
+ * Allow models to override to_xml. #4989 [Blair Zajac <blair@orcaware.com>]
1287
+
1288
+ * PostgreSQL: don't ignore port when host is nil since it's often used to label the domain socket. #5247 [shimbo@is.naist.jp]
1289
+
1290
+ * Records and arrays of records are bound as quoted ids. [Jeremy Kemper]
1291
+ Foo.find(:all, :conditions => ['bar_id IN (?)', bars])
1292
+ Foo.find(:first, :conditions => ['bar_id = ?', bar])
1293
+
1294
+ * Fixed that Base.find :all, :conditions => [ "id IN (?)", collection ] would fail if collection was empty [DHH]
1295
+
1296
+ * Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
1297
+
1298
+ * Fix the has_and_belongs_to_many #create doesn't populate the join for new records. Closes #3692 [josh@hasmanythrough.com]
1299
+
1300
+ * Provide Association Extensions access to the instance that the association is being accessed from.
1301
+ Closes #4433 [josh@hasmanythrough.com]
1302
+
1303
+ * Update OpenBase adaterp's maintainer's email address. Closes #5176. [Derrick Spell]
1304
+
1305
+ * Add a quick note about :select and eagerly included associations. [Rick]
1306
+
1307
+ * Add docs for the :as option in has_one associations. Closes #5144 [cdcarter@gmail.com]
1308
+
1309
+ * Fixed that has_many collections shouldn't load the entire association to do build or create [DHH]
1310
+
1311
+ * Added :allow_nil option for aggregations #5091 [ian.w.white@gmail.com]
1312
+
1313
+ * Fix Oracle boolean support and tests. Closes #5139. [schoenm@earthlink.net]
1314
+
1315
+ * create! no longer blows up when no attributes are passed and a :create scope is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.) [Jeremy Kemper]
1316
+
1317
+ * Call Inflector#demodulize on the class name when eagerly including an STI model. Closes #5077 [info@loobmedia.com]
1318
+
1319
+ * Preserve MySQL boolean column defaults when changing a column in a migration. Closes #5015. [pdcawley@bofh.org.uk]
1320
+
1321
+ * PostgreSQL: migrations support :limit with :integer columns by mapping limit < 4 to smallint, > 4 to bigint, and anything else to integer. #2900 [keegan@thebasement.org]
1322
+
1323
+ * Dates and times interpret empty strings as nil rather than 2000-01-01. #4830 [kajism@yahoo.com]
1324
+
1325
+ * Allow :uniq => true with has_many :through associations. [Jeremy Kemper]
1326
+
1327
+ * Ensure that StringIO is always available for the Schema dumper. [Marcel Molina Jr.]
1328
+
1329
+ * Allow AR::Base#to_xml to include methods too. Closes #4921. [johan@textdrive.com]
1330
+
1331
+ * Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac <blair@orcaware.com>]
1332
+
1333
+ * When grouping, use the appropriate option key. [Marcel Molina Jr.]
1334
+
1335
+ * Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
1336
+
1337
+ * Add warning about the proper way to validate the presence of a foreign key. Closes #4147. [Francois Beausoleil <francois.beausoleil@gmail.com>]
1338
+
1339
+ * Fix syntax error in documentation. Closes #4679. [mislav@nippur.irb.hr]
1340
+
1341
+ * Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu]
1342
+
1343
+ * Various fixes for sqlserver_adapter (odbc statement finishing, ado schema dumper, drop index). Closes #4831. [kajism@yahoo.com]
1344
+
1345
+ * Add support for :order option to with_scope. Closes #3887. [eric.daspet@survol.net]
1346
+
1347
+ * Prettify output of schema_dumper by making things line up. Closes #4241 [Caio Chassot <caio@v2studio.com>]
1348
+
1349
+ * Make build_postgresql_databases task make databases owned by the postgres user. Closes #4790. [mlaster@metavillage.com]
1350
+
1351
+ * Sybase Adapter type conversion cleanup. Closes #4736. [dev@metacasa.net]
1352
+
1353
+ * Fix bug where calculations with long alias names return null. [Rick]
1354
+
1355
+ * Raise error when trying to add to a has_many :through association. Use the Join Model instead. [Rick]
1356
+
1357
+ @post.tags << @tag # BAD
1358
+ @post.taggings.create(:tag => @tag) # GOOD
1359
+
1360
+ * Allow all calculations to take the :include option, not just COUNT (closes #4840) [Rick]
1361
+
1362
+ * Add ActiveRecord::Errors#to_xml [Jamis Buck]
1363
+
1364
+ * Properly quote index names in migrations (closes #4764) [John Long]
1365
+
1366
+ * Fix the HasManyAssociation#count method so it uses the new ActiveRecord::Base#count syntax, while maintaining backwards compatibility. [Rick]
1367
+
1368
+ * Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
1369
+
1370
+ * Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
1371
+
1372
+ * Add :case_sensitive option to validates_uniqueness_of (closes #3090) [Rick]
1373
+
1374
+ class Account < ActiveRecord::Base
1375
+ validates_uniqueness_of :email, :case_sensitive => false
1376
+ end
1377
+
1378
+ * Allow multiple association extensions with :extend option (closes #4666) [Josh Susser]
1379
+
1380
+ class Account < ActiveRecord::Base
1381
+ has_many :people, :extend => [FindOrCreateByNameExtension, FindRecentExtension]
1382
+ end
1383
+
1384
+
1385
+ *1.14.4* (August 8th, 2006)
1386
+
1387
+ * Add warning about the proper way to validate the presence of a foreign key. #4147 [Francois Beausoleil <francois.beausoleil@gmail.com>]
1388
+
1389
+ * Fix syntax error in documentation. #4679 [mislav@nippur.irb.hr]
1390
+
1391
+ * Update inconsistent migrations documentation. #4683 [machomagna@gmail.com]
1392
+
1393
+
1394
+ *1.14.3* (June 27th, 2006)
1395
+
1396
+ * Fix announcement of very long migration names. #5722 [blake@near-time.com]
1397
+
1398
+ * Update callbacks documentation. #3970 [Robby Russell <robby@planetargon.com>]
1399
+
1400
+ * Properly quote index names in migrations (closes #4764) [John Long]
1401
+
1402
+ * Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
1403
+
1404
+ * Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
500
1405
 
501
1406
 
502
1407
  *1.14.2* (April 9th, 2006)
@@ -504,6 +1409,1521 @@
504
1409
  * Fixed calculations for the Oracle Adapter (closes #4626) [Michael Schoen]
505
1410
 
506
1411
 
1412
+ *1.14.1* (April 6th, 2006)
1413
+
1414
+ * Fix type_name_with_module to handle type names that begin with '::'. Closes #4614. [Nicholas Seckar]
1415
+
1416
+ * Fixed that that multiparameter assignment doesn't work with aggregations (closes #4620) [Lars Pind]
1417
+
1418
+ * Enable Limit/Offset in Calculations (closes #4558) [lmarlow@yahoo.com]
1419
+
1420
+ * Fixed that loading including associations returns all results if Load IDs For Limited Eager Loading returns none (closes #4528) [Rick]
1421
+
1422
+ * Fixed HasManyAssociation#find bugs when :finder_sql is set #4600 [lagroue@free.fr]
1423
+
1424
+ * Allow AR::Base#respond_to? to behave when @attributes is nil [zenspider]
1425
+
1426
+ * Support eager includes when going through a polymorphic has_many association. [Rick]
1427
+
1428
+ * Added support for eagerly including polymorphic has_one associations. (closes #4525) [Rick]
1429
+
1430
+ class Post < ActiveRecord::Base
1431
+ has_one :tagging, :as => :taggable
1432
+ end
1433
+
1434
+ Post.find :all, :include => :tagging
1435
+
1436
+ * Added descriptive error messages for invalid has_many :through associations: going through :has_one or :has_and_belongs_to_many [Rick]
1437
+
1438
+ * Added support for going through a polymorphic has_many association: (closes #4401) [Rick]
1439
+
1440
+ class PhotoCollection < ActiveRecord::Base
1441
+ has_many :photos, :as => :photographic
1442
+ belongs_to :firm
1443
+ end
1444
+
1445
+ class Firm < ActiveRecord::Base
1446
+ has_many :photo_collections
1447
+ has_many :photos, :through => :photo_collections
1448
+ end
1449
+
1450
+ * Multiple fixes and optimizations in PostgreSQL adapter, allowing ruby-postgres gem to work properly. [ruben.nine@gmail.com]
1451
+
1452
+ * Fixed that AssociationCollection#delete_all should work even if the records of the association are not loaded yet. [Florian Weber]
1453
+
1454
+ * Changed those private ActiveRecord methods to take optional third argument :auto instead of nil for performance optimizations. (closes #4456) [Stefan]
1455
+
1456
+ * Private ActiveRecord methods add_limit!, add_joins!, and add_conditions! take an OPTIONAL third argument 'scope' (closes #4456) [Rick]
1457
+
1458
+ * DEPRECATED: Using additional attributes on has_and_belongs_to_many associations. Instead upgrade your association to be a real join model [DHH]
1459
+
1460
+ * Fixed that records returned from has_and_belongs_to_many associations with additional attributes should be marked as read only (fixes #4512) [DHH]
1461
+
1462
+ * Do not implicitly mark recordss of has_many :through as readonly but do mark habtm records as readonly (eventually only on join tables without rich attributes). [Marcel Mollina Jr.]
1463
+
1464
+ * Fixed broken OCIAdapter #4457 [schoenm@earthlink.net]
1465
+
1466
+
1467
+ *1.14.0* (March 27th, 2006)
1468
+
1469
+ * Replace 'rescue Object' with a finer grained rescue. Closes #4431. [Nicholas Seckar]
1470
+
1471
+ * Fixed eager loading so that an aliased table cannot clash with a has_and_belongs_to_many join table [Rick]
1472
+
1473
+ * Add support for :include to with_scope [andrew@redlinesoftware.com]
1474
+
1475
+ * Support the use of public synonyms with the Oracle adapter; required ruby-oci8 v0.1.14 #4390 [schoenm@earthlink.net]
1476
+
1477
+ * Change periods (.) in table aliases to _'s. Closes #4251 [jeff@ministrycentered.com]
1478
+
1479
+ * Changed has_and_belongs_to_many join to INNER JOIN for Mysql 3.23.x. Closes #4348 [Rick]
1480
+
1481
+ * Fixed issue that kept :select options from being scoped [Rick]
1482
+
1483
+ * Fixed db_schema_import when binary types are present #3101 [DHH]
1484
+
1485
+ * Fixed that MySQL enums should always be returned as strings #3501 [DHH]
1486
+
1487
+ * Change has_many :through to use the :source option to specify the source association. :class_name is now ignored. [Rick Olson]
1488
+
1489
+ class Connection < ActiveRecord::Base
1490
+ belongs_to :user
1491
+ belongs_to :channel
1492
+ end
1493
+
1494
+ class Channel < ActiveRecord::Base
1495
+ has_many :connections
1496
+ has_many :contacts, :through => :connections, :class_name => 'User' # OLD
1497
+ has_many :contacts, :through => :connections, :source => :user # NEW
1498
+ end
1499
+
1500
+ * Fixed DB2 adapter so nullable columns will be determines correctly now and quotes from column default values will be removed #4350 [contact@maik-schmidt.de]
1501
+
1502
+ * Allow overriding of find parameters in scoped has_many :through calls [Rick Olson]
1503
+
1504
+ In this example, :include => false disables the default eager association from loading. :select changes the standard
1505
+ select clause. :joins specifies a join that is added to the end of the has_many :through query.
1506
+
1507
+ class Post < ActiveRecord::Base
1508
+ has_many :tags, :through => :taggings, :include => :tagging do
1509
+ def add_joins_and_select
1510
+ find :all, :select => 'tags.*, authors.id as author_id', :include => false,
1511
+ :joins => 'left outer join posts on taggings.taggable_id = posts.id left outer join authors on posts.author_id = authors.id'
1512
+ end
1513
+ end
1514
+ end
1515
+
1516
+ * Fixed that schema changes while the database was open would break any connections to a SQLite database (now we reconnect if that error is throw) [DHH]
1517
+
1518
+ * Don't classify the has_one class when eager loading, it is already singular. Add tests. (closes #4117) [jonathan@bluewire.net.nz]
1519
+
1520
+ * Quit ignoring default :include options in has_many :through calls [Mark James]
1521
+
1522
+ * Allow has_many :through associations to find the source association by setting a custom class (closes #4307) [jonathan@bluewire.net.nz]
1523
+
1524
+ * Eager Loading support added for has_many :through => :has_many associations (see below). [Rick Olson]
1525
+
1526
+ * Allow has_many :through to work on has_many associations (closes #3864) [sco@scottraymond.net] Example:
1527
+
1528
+ class Firm < ActiveRecord::Base
1529
+ has_many :clients
1530
+ has_many :invoices, :through => :clients
1531
+ end
1532
+
1533
+ class Client < ActiveRecord::Base
1534
+ belongs_to :firm
1535
+ has_many :invoices
1536
+ end
1537
+
1538
+ class Invoice < ActiveRecord::Base
1539
+ belongs_to :client
1540
+ end
1541
+
1542
+ * Raise error when trying to select many polymorphic objects with has_many :through or :include (closes #4226) [josh@hasmanythrough.com]
1543
+
1544
+ * Fixed has_many :through to include :conditions set on the :through association. closes #4020 [jonathan@bluewire.net.nz]
1545
+
1546
+ * Fix that has_many :through honors the foreign key set by the belongs_to association in the join model (closes #4259) [andylien@gmail.com / Rick]
1547
+
1548
+ * SQL Server adapter gets some love #4298 [rtomayko@gmail.com]
1549
+
1550
+ * Added OpenBase database adapter that builds on top of the http://www.spice-of-life.net/ruby-openbase/ driver. All functionality except LIMIT/OFFSET is supported #3528 [derrickspell@cdmplus.com]
1551
+
1552
+ * Rework table aliasing to account for truncated table aliases. Add smarter table aliasing when doing eager loading of STI associations. This allows you to use the association name in the order/where clause. [Jonathan Viney / Rick Olson] #4108 Example (SpecialComment is using STI):
1553
+
1554
+ Author.find(:all, :include => { :posts => :special_comments }, :order => 'special_comments.body')
1555
+
1556
+ * Add AbstractAdapter#table_alias_for to create table aliases according to the rules of the current adapter. [Rick]
1557
+
1558
+ * Provide access to the underlying database connection through Adapter#raw_connection. Enables the use of db-specific methods without complicating the adapters. #2090 [Koz]
1559
+
1560
+ * Remove broken attempts at handling columns with a default of 'now()' in the postgresql adapter. #2257 [Koz]
1561
+
1562
+ * Added connection#current_database that'll return of the current database (only works in MySQL, SQL Server, and Oracle so far -- please help implement for the rest of the adapters) #3663 [Tom ward]
1563
+
1564
+ * Fixed that Migration#execute would have the table name prefix appended to its query #4110 [mark.imbriaco@pobox.com]
1565
+
1566
+ * Make all tinyint(1) variants act like boolean in mysql (tinyint(1) unsigned, etc.) [Jamis Buck]
1567
+
1568
+ * Use association's :conditions when eager loading. [jeremyevans0@gmail.com] #4144
1569
+
1570
+ * Alias the has_and_belongs_to_many join table on eager includes. #4106 [jeremyevans0@gmail.com]
1571
+
1572
+ This statement would normally error because the projects_developers table is joined twice, and therefore joined_on would be ambiguous.
1573
+
1574
+ Developer.find(:all, :include => {:projects => :developers}, :conditions => 'join_project_developers.joined_on IS NOT NULL')
1575
+
1576
+ * Oracle adapter gets some love #4230 [schoenm@earthlink.net]
1577
+
1578
+ * Changes :text to CLOB rather than BLOB [Moses Hohman]
1579
+ * Fixes an issue with nil numeric length/scales (several)
1580
+ * Implements support for XMLTYPE columns [wilig / Kubo Takehiro]
1581
+ * Tweaks a unit test to get it all green again
1582
+ * Adds support for #current_database
1583
+
1584
+ * Added Base.abstract_class? that marks which classes are not part of the Active Record hierarchy #3704 [Rick Olson]
1585
+
1586
+ class CachedModel < ActiveRecord::Base
1587
+ self.abstract_class = true
1588
+ end
1589
+
1590
+ class Post < CachedModel
1591
+ end
1592
+
1593
+ CachedModel.abstract_class?
1594
+ => true
1595
+
1596
+ Post.abstract_class?
1597
+ => false
1598
+
1599
+ Post.base_class
1600
+ => Post
1601
+
1602
+ Post.table_name
1603
+ => 'posts'
1604
+
1605
+ * Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]
1606
+
1607
+ class Foo < ActiveRecord::Base
1608
+ has_many :attachments, :as => :attachable, :dependent => :delete_all
1609
+ end
1610
+
1611
+ * Nicer error message on has_many :through when :through reflection can not be found. #4042 [court3nay@gmail.com]
1612
+
1613
+ * Upgrade to Transaction::Simple 1.3 [Jamis Buck]
1614
+
1615
+ * Catch FixtureClassNotFound when using instantiated fixtures on a fixture that has no ActiveRecord model [Rick Olson]
1616
+
1617
+ * Allow ordering of calculated results and/or grouped fields in calculations [solo@gatelys.com]
1618
+
1619
+ * Make ActiveRecord::Base#save! return true instead of nil on success. #4173 [johan@johansorensen.com]
1620
+
1621
+ * Dynamically set allow_concurrency. #4044 [Stefan Kaes]
1622
+
1623
+ * Added Base#to_xml that'll turn the current record into a XML representation [DHH]. Example:
1624
+
1625
+ topic.to_xml
1626
+
1627
+ ...returns:
1628
+
1629
+ <?xml version="1.0" encoding="UTF-8"?>
1630
+ <topic>
1631
+ <title>The First Topic</title>
1632
+ <author-name>David</author-name>
1633
+ <id type="integer">1</id>
1634
+ <approved type="boolean">false</approved>
1635
+ <replies-count type="integer">0</replies-count>
1636
+ <bonus-time type="datetime">2000-01-01 08:28:00</bonus-time>
1637
+ <written-on type="datetime">2003-07-16 09:28:00</written-on>
1638
+ <content>Have a nice day</content>
1639
+ <author-email-address>david@loudthinking.com</author-email-address>
1640
+ <parent-id></parent-id>
1641
+ <last-read type="date">2004-04-15</last-read>
1642
+ </topic>
1643
+
1644
+ ...and you can configure with:
1645
+
1646
+ topic.to_xml(:skip_instruct => true, :except => [ :id, bonus_time, :written_on, replies_count ])
1647
+
1648
+ ...that'll return:
1649
+
1650
+ <topic>
1651
+ <title>The First Topic</title>
1652
+ <author-name>David</author-name>
1653
+ <approved type="boolean">false</approved>
1654
+ <content>Have a nice day</content>
1655
+ <author-email-address>david@loudthinking.com</author-email-address>
1656
+ <parent-id></parent-id>
1657
+ <last-read type="date">2004-04-15</last-read>
1658
+ </topic>
1659
+
1660
+ You can even do load first-level associations as part of the document:
1661
+
1662
+ firm.to_xml :include => [ :account, :clients ]
1663
+
1664
+ ...that'll return something like:
1665
+
1666
+ <?xml version="1.0" encoding="UTF-8"?>
1667
+ <firm>
1668
+ <id type="integer">1</id>
1669
+ <rating type="integer">1</rating>
1670
+ <name>37signals</name>
1671
+ <clients>
1672
+ <client>
1673
+ <rating type="integer">1</rating>
1674
+ <name>Summit</name>
1675
+ </client>
1676
+ <client>
1677
+ <rating type="integer">1</rating>
1678
+ <name>Microsoft</name>
1679
+ </client>
1680
+ </clients>
1681
+ <account>
1682
+ <id type="integer">1</id>
1683
+ <credit-limit type="integer">50</credit-limit>
1684
+ </account>
1685
+ </firm>
1686
+
1687
+ * Allow :counter_cache to take a column name for custom counter cache columns [Jamis Buck]
1688
+
1689
+ * Documentation fixes for :dependent [robby@planetargon.com]
1690
+
1691
+ * Stop the MySQL adapter crashing when views are present. #3782 [Jonathan Viney]
1692
+
1693
+ * Don't classify the belongs_to class, it is already singular #4117 [keithm@infused.org]
1694
+
1695
+ * Allow set_fixture_class to take Classes instead of strings for a class in a module. Raise FixtureClassNotFound if a fixture can't load. [Rick Olson]
1696
+
1697
+ * Fix quoting of inheritance column for STI eager loading #4098 [Jonathan Viney <jonathan@bluewire.net.nz>]
1698
+
1699
+ * Added smarter table aliasing for eager associations for multiple self joins #3580 [Rick Olson]
1700
+
1701
+ * The first time a table is referenced in a join, no alias is used.
1702
+ * After that, the parent class name and the reflection name are used.
1703
+
1704
+ Tree.find(:all, :include => :children) # LEFT OUTER JOIN trees AS tree_children ...
1705
+
1706
+ * Any additional join references get a numerical suffix like '_2', '_3', etc.
1707
+
1708
+ * Fixed eager loading problems with single-table inheritance #3580 [Rick Olson]. Post.find(:all, :include => :special_comments) now returns all posts, and any special comments that the posts may have. And made STI work with has_many :through and polymorphic belongs_to.
1709
+
1710
+ * Added cascading eager loading that allows for queries like Author.find(:all, :include=> { :posts=> :comments }), which will fetch all authors, their posts, and the comments belonging to those posts in a single query (using LEFT OUTER JOIN) #3913 [anna@wota.jp]. Examples:
1711
+
1712
+ # cascaded in two levels
1713
+ >> Author.find(:all, :include=>{:posts=>:comments})
1714
+ => authors
1715
+ +- posts
1716
+ +- comments
1717
+
1718
+ # cascaded in two levels and normal association
1719
+ >> Author.find(:all, :include=>[{:posts=>:comments}, :categorizations])
1720
+ => authors
1721
+ +- posts
1722
+ +- comments
1723
+ +- categorizations
1724
+
1725
+ # cascaded in two levels with two has_many associations
1726
+ >> Author.find(:all, :include=>{:posts=>[:comments, :categorizations]})
1727
+ => authors
1728
+ +- posts
1729
+ +- comments
1730
+ +- categorizations
1731
+
1732
+ # cascaded in three levels
1733
+ >> Company.find(:all, :include=>{:groups=>{:members=>{:favorites}}})
1734
+ => companies
1735
+ +- groups
1736
+ +- members
1737
+ +- favorites
1738
+
1739
+ * Make counter cache work when replacing an association #3245 [eugenol@gmail.com]
1740
+
1741
+ * Make migrations verbose [Jamis Buck]
1742
+
1743
+ * Make counter_cache work with polymorphic belongs_to [Jamis Buck]
1744
+
1745
+ * Fixed that calling HasOneProxy#build_model repeatedly would cause saving to happen #4058 [anna@wota.jp]
1746
+
1747
+ * Added Sybase database adapter that relies on the Sybase Open Client bindings (see http://raa.ruby-lang.org/project/sybase-ctlib) #3765 [John Sheets]. It's almost completely Active Record compliant (including migrations), but has the following caveats:
1748
+
1749
+ * Does not support DATE SQL column types; use DATETIME instead.
1750
+ * Date columns on HABTM join tables are returned as String, not Time.
1751
+ * Insertions are potentially broken for :polymorphic join tables
1752
+ * BLOB column access not yet fully supported
1753
+
1754
+ * Clear stale, cached connections left behind by defunct threads. [Jeremy Kemper]
1755
+
1756
+ * CHANGED DEFAULT: set ActiveRecord::Base.allow_concurrency to false. Most AR usage is in single-threaded applications. [Jeremy Kemper]
1757
+
1758
+ * Renamed the "oci" adapter to "oracle", but kept the old name as an alias #4017 [schoenm@earthlink.net]
1759
+
1760
+ * Fixed that Base.save should always return false if the save didn't succeed, including if it has halted by before_save's #1861, #2477 [DHH]
1761
+
1762
+ * Speed up class -> connection caching and stale connection verification. #3979 [Stefan Kaes]
1763
+
1764
+ * Add set_fixture_class to allow the use of table name accessors with models which use set_table_name. [Kevin Clark]
1765
+
1766
+ * Added that fixtures to placed in subdirectories of the main fixture files are also loaded #3937 [dblack@wobblini.net]
1767
+
1768
+ * Define attribute query methods to avoid method_missing calls. #3677 [jonathan@bluewire.net.nz]
1769
+
1770
+ * ActiveRecord::Base.remove_connection explicitly closes database connections and doesn't corrupt the connection cache. Introducing the disconnect! instance method for the PostgreSQL, MySQL, and SQL Server adapters; implementations for the others are welcome. #3591 [Simon Stapleton, Tom Ward]
1771
+
1772
+ * Added support for nested scopes #3407 [anna@wota.jp]. Examples:
1773
+
1774
+ Developer.with_scope(:find => { :conditions => "salary > 10000", :limit => 10 }) do
1775
+ Developer.find(:all) # => SELECT * FROM developers WHERE (salary > 10000) LIMIT 10
1776
+
1777
+ # inner rule is used. (all previous parameters are ignored)
1778
+ Developer.with_exclusive_scope(:find => { :conditions => "name = 'Jamis'" }) do
1779
+ Developer.find(:all) # => SELECT * FROM developers WHERE (name = 'Jamis')
1780
+ end
1781
+
1782
+ # parameters are merged
1783
+ Developer.with_scope(:find => { :conditions => "name = 'Jamis'" }) do
1784
+ Developer.find(:all) # => SELECT * FROM developers WHERE (( salary > 10000 ) AND ( name = 'Jamis' )) LIMIT 10
1785
+ end
1786
+ end
1787
+
1788
+ * Fixed db2 connection with empty user_name and auth options #3622 [phurley@gmail.com]
1789
+
1790
+ * Fixed validates_length_of to work on UTF-8 strings by using characters instead of bytes #3699 [Masao Mutoh]
1791
+
1792
+ * Fixed that reflections would bleed across class boundaries in single-table inheritance setups #3796 [lars@pind.com]
1793
+
1794
+ * Added calculations: Base.count, Base.average, Base.sum, Base.minimum, Base.maxmium, and the generic Base.calculate. All can be used with :group and :having. Calculations and statitics need no longer require custom SQL. #3958 [Rick Olson]. Examples:
1795
+
1796
+ Person.average :age
1797
+ Person.minimum :age
1798
+ Person.maximum :age
1799
+ Person.sum :salary, :group => :last_name
1800
+
1801
+ * Renamed Errors#count to Errors#size but kept an alias for the old name (and included an alias for length too) #3920 [contact@lukeredpath.co.uk]
1802
+
1803
+ * Reflections don't attempt to resolve module nesting of association classes. Simplify type computation. [Jeremy Kemper]
1804
+
1805
+ * Improved the Oracle OCI Adapter with better performance for column reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) #3879 [Aggregated by schoenm@earthlink.net]
1806
+
1807
+ * Fixed that the schema_info table used by ActiveRecord::Schema.define should respect table pre- and suffixes #3834 [rubyonrails@atyp.de]
1808
+
1809
+ * Added :select option to Base.count that'll allow you to select something else than * to be counted on. Especially important for count queries using DISTINCT #3839 [skaes]
1810
+
1811
+ * Correct syntax error in mysql DDL, and make AAACreateTablesTest run first [Bob Silva]
1812
+
1813
+ * Allow :include to be used with has_many :through associations #3611 [Michael Schoen]
1814
+
1815
+ * PostgreSQL: smarter schema dumps using pk_and_sequence_for(table). #2920 [Blair Zajac]
1816
+
1817
+ * SQLServer: more compatible limit/offset emulation. #3779 [Tom Ward]
1818
+
1819
+ * Polymorphic join support for has_one associations (has_one :foo, :as => :bar) #3785 [Rick Olson]
1820
+
1821
+ * PostgreSQL: correctly parse negative integer column defaults. #3776 [bellis@deepthought.org]
1822
+
1823
+ * Fix problems with count when used with :include [Jeremy Hopple and Kevin Clark]
1824
+
1825
+ * ActiveRecord::RecordInvalid now states which validations failed in its default error message [Tobias Luetke]
1826
+
1827
+ * Using AssociationCollection#build with arrays of hashes should call build, not create [DHH]
1828
+
1829
+ * Remove definition of reloadable? from ActiveRecord::Base to make way for new Reloadable code. [Nicholas Seckar]
1830
+
1831
+ * Fixed schema handling for DB2 adapter that didn't work: an initial schema could be set, but it wasn't used when getting tables and indexes #3678 [Maik Schmidt]
1832
+
1833
+ * Support the :column option for remove_index with the PostgreSQL adapter. #3661 [shugo@ruby-lang.org]
1834
+
1835
+ * Add documentation for add_index and remove_index. #3600 [Manfred Stienstra <m.stienstra@fngtps.com>]
1836
+
1837
+ * If the OCI library is not available, raise an exception indicating as much. #3593 [schoenm@earthlink.net]
1838
+
1839
+ * Add explicit :order in finder tests as postgresql orders results differently by default. #3577. [Rick Olson]
1840
+
1841
+ * Make dynamic finders honor additional passed in :conditions. #3569 [Oleg Pudeyev <pudeyo@rpi.edu>, Marcel Molina Jr.]
1842
+
1843
+ * Show a meaningful error when the DB2 adapter cannot be loaded due to missing dependencies. [Nicholas Seckar]
1844
+
1845
+ * Make .count work for has_many associations with multi line finder sql [schoenm@earthlink.net]
1846
+
1847
+ * Add AR::Base.base_class for querying the ancestor AR::Base subclass [Jamis Buck]
1848
+
1849
+ * Allow configuration of the column used for optimistic locking [wilsonb@gmail.com]
1850
+
1851
+ * Don't hardcode 'id' in acts as list. [ror@philippeapril.com]
1852
+
1853
+ * Fix date errors for SQLServer in association tests. #3406 [kevin.clark@gmal.com]
1854
+
1855
+ * Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
1856
+
1857
+ * Disambiguate table names for columns in validates_uniquness_of's WHERE clause. #3423 [alex.borovsky@gmail.com]
1858
+
1859
+ * .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]
1860
+
1861
+ * Don't raise an exception when there are more keys than there are named bind variables when sanitizing conditions. [Marcel Molina Jr.]
1862
+
1863
+ * Multiple enhancements and adjustments to DB2 adaptor. #3377 [contact@maik-schmidt.de]
1864
+
1865
+ * Sanitize scoped conditions. [Marcel Molina Jr.]
1866
+
1867
+ * Added option to Base.reflection_of_all_associations to specify a specific association to scope the call. For example Base.reflection_of_all_associations(:has_many) [DHH]
1868
+
1869
+ * Added ActiveRecord::SchemaDumper.ignore_tables which tells SchemaDumper which tables to ignore. Useful for tables with funky column like the ones required for tsearch2. [TobiasLuetke]
1870
+
1871
+ * SchemaDumper now doesn't fail anymore when there are unknown column types in the schema. Instead the table is ignored and a Comment is left in the schema.rb. [TobiasLuetke]
1872
+
1873
+ * Fixed that saving a model with multiple habtm associations would only save the first one. #3244 [yanowitz-rubyonrails@quantumfoam.org, Florian Weber]
1874
+
1875
+ * Fix change_column to work with PostgreSQL 7.x and 8.x. #3141 [wejn@box.cz, Rick Olson, Scott Barron]
1876
+
1877
+ * removed :piggyback in favor of just allowing :select on :through associations. [Tobias Luetke]
1878
+
1879
+ * made method missing delegation to class methods on relation target work on :through associations. [Tobias Luetke]
1880
+
1881
+ * made .find() work on :through relations. [Tobias Luetke]
1882
+
1883
+ * Fix typo in association docs. #3296. [Blair Zajac]
1884
+
1885
+ * Fixed :through relations when using STI inherited classes would use the inherited class's name as foreign key on the join model [Tobias Luetke]
1886
+
1887
+ *1.13.2* (December 13th, 2005)
1888
+
1889
+ * Become part of Rails 1.0
1890
+
1891
+ * MySQL: allow encoding option for mysql.rb driver. [Jeremy Kemper]
1892
+
1893
+ * Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH]. Example:
1894
+
1895
+ class Post
1896
+ has_many :recent_comments, :class_name => "Comment", :limit => 10, :include => :author
1897
+ end
1898
+
1899
+ post.recent_comments.find(:all) # Uses LIMIT 10 and includes authors
1900
+ post.recent_comments.find(:all, :limit => nil) # Uses no limit but include authors
1901
+ post.recent_comments.find(:all, :limit => nil, :include => nil) # Uses no limit and doesn't include authors
1902
+
1903
+ * Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH]
1904
+
1905
+ * MySQL: fixes for the bundled mysql.rb driver. #3160 [Justin Forder]
1906
+
1907
+ * SQLServer: fix obscure optimistic locking bug. #3068 [kajism@yahoo.com]
1908
+
1909
+ * SQLServer: support uniqueidentifier columns. #2930 [keithm@infused.org]
1910
+
1911
+ * SQLServer: cope with tables names qualified by owner. #3067 [jeff@ministrycentered.com]
1912
+
1913
+ * SQLServer: cope with columns with "desc" in the name. #1950 [Ron Lusk, Ryan Tomayko]
1914
+
1915
+ * SQLServer: cope with primary keys with "select" in the name. #3057 [rdifrango@captechventures.com]
1916
+
1917
+ * Oracle: active? performs a select instead of a commit. #3133 [Michael Schoen]
1918
+
1919
+ * MySQL: more robust test for nullified result hashes. #3124 [Stefan Kaes]
1920
+
1921
+ * Reloading an instance refreshes its aggregations as well as its associations. #3024 [François Beausoleil]
1922
+
1923
+ * Fixed that using :include together with :conditions array in Base.find would cause NoMethodError #2887 [Paul Hammmond]
1924
+
1925
+ * PostgreSQL: more robust sequence name discovery. #3087 [Rick Olson]
1926
+
1927
+ * Oracle: use syntax compatible with Oracle 8. #3131 [Michael Schoen]
1928
+
1929
+ * MySQL: work around ruby-mysql/mysql-ruby inconsistency with mysql.stat. Eliminate usage of mysql.ping because it doesn't guarantee reconnect. Explicitly close and reopen the connection instead. [Jeremy Kemper]
1930
+
1931
+ * Added preliminary support for polymorphic associations [DHH]
1932
+
1933
+ * Added preliminary support for join models [DHH]
1934
+
1935
+ * Allow validate_uniqueness_of to be scoped by more than just one column. #1559. [jeremy@jthopple.com, Marcel Molina Jr.]
1936
+
1937
+ * Firebird: active? and reconnect! methods for handling stale connections. #428 [Ken Kunz <kennethkunz@gmail.com>]
1938
+
1939
+ * Firebird: updated for FireRuby 0.4.0. #3009 [Ken Kunz <kennethkunz@gmail.com>]
1940
+
1941
+ * MySQL and PostgreSQL: active? compatibility with the pure-Ruby driver. #428 [Jeremy Kemper]
1942
+
1943
+ * Oracle: active? check pings the database rather than testing the last command status. #428 [Michael Schoen]
1944
+
1945
+ * SQLServer: resolve column aliasing/quoting collision when using limit or offset in an eager find. #2974 [kajism@yahoo.com]
1946
+
1947
+ * Reloading a model doesn't lose track of its connection. #2996 [junk@miriamtech.com, Jeremy Kemper]
1948
+
1949
+ * Fixed bug where using update_attribute after pushing a record to a habtm association of the object caused duplicate rows in the join table. #2888 [colman@rominato.com, Florian Weber, Michael Schoen]
1950
+
1951
+ * MySQL, PostgreSQL: reconnect! also reconfigures the connection. Otherwise, the connection 'loses' its settings if it times out and is reconnected. #2978 [Shugo Maeda]
1952
+
1953
+ * has_and_belongs_to_many: use JOIN instead of LEFT JOIN. [Jeremy Kemper]
1954
+
1955
+ * MySQL: introduce :encoding option to specify the character set for client, connection, and results. Only available for MySQL 4.1 and later with the mysql-ruby driver. Do SHOW CHARACTER SET in mysql client to see available encodings. #2975 [Shugo Maeda]
1956
+
1957
+ * Add tasks to create, drop and rebuild the MySQL and PostgreSQL test databases. [Marcel Molina Jr.]
1958
+
1959
+ * Correct boolean handling in generated reader methods. #2945 [don.park@gmail.com, Stefan Kaes]
1960
+
1961
+ * Don't generate read methods for columns whose names are not valid ruby method names. #2946 [Stefan Kaes]
1962
+
1963
+ * Document :force option to create_table. #2921 [Blair Zajac <blair@orcaware.com>]
1964
+
1965
+ * Don't add the same conditions twice in has_one finder sql. #2916 [Jeremy Evans]
1966
+
1967
+ * Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
1968
+
1969
+ * Introducing the Firebird adapter. Quote columns and use attribute_condition more consistently. Setup guide: http://wiki.rubyonrails.com/rails/pages/Firebird+Adapter #1874 [Ken Kunz <kennethkunz@gmail.com>]
1970
+
1971
+ * SQLServer: active? and reconnect! methods for handling stale connections. #428 [kajism@yahoo.com, Tom Ward <tom@popdog.net>]
1972
+
1973
+ * Associations handle case-equality more consistently: item.parts.is_a?(Array) and item.parts === Array. #1345 [MarkusQ@reality.com]
1974
+
1975
+ * SQLServer: insert uses given primary key value if not nil rather than SELECT @@IDENTITY. #2866 [kajism@yahoo.com, Tom Ward <tom@popdog.net>]
1976
+
1977
+ * Oracle: active? and reconnect! methods for handling stale connections. Optionally retry queries after reconnect. #428 [Michael Schoen <schoenm@earthlink.net>]
1978
+
1979
+ * Correct documentation for Base.delete_all. #1568 [Newhydra]
1980
+
1981
+ * Oracle: test case for column default parsing. #2788 [Michael Schoen <schoenm@earthlink.net>]
1982
+
1983
+ * Update documentation for Migrations. #2861 [Tom Werner <tom@cube6media.com>]
1984
+
1985
+ * When AbstractAdapter#log rescues an exception, attempt to detect and reconnect to an inactive database connection. Connection adapter must respond to the active? and reconnect! instance methods. Initial support for PostgreSQL, MySQL, and SQLite. Make certain that all statements which may need reconnection are performed within a logged block: for example, this means no avoiding log(sql, name) { } if @logger.nil? #428 [Jeremy Kemper]
1986
+
1987
+ * Oracle: Much faster column reflection. #2848 [Michael Schoen <schoenm@earthlink.net>]
1988
+
1989
+ * Base.reset_sequence_name analogous to reset_table_name (mostly useful for testing). Base.define_attr_method allows nil values. [Jeremy Kemper]
1990
+
1991
+ * PostgreSQL: smarter sequence name defaults, stricter last_insert_id, warn on pk without sequence. [Jeremy Kemper]
1992
+
1993
+ * PostgreSQL: correctly discover custom primary key sequences. #2594 [Blair Zajac <blair@orcaware.com>, meadow.nnick@gmail.com, Jeremy Kemper]
1994
+
1995
+ * SQLServer: don't report limits for unsupported field types. #2835 [Ryan Tomayko]
1996
+
1997
+ * Include the Enumerable module in ActiveRecord::Errors. [Rick Bradley <rick@rickbradley.com>]
1998
+
1999
+ * Add :group option, correspond to GROUP BY, to the find method and to the has_many association. #2818 [rubyonrails@atyp.de]
2000
+
2001
+ * Don't cast nil or empty strings to a dummy date. #2789 [Rick Bradley <rick@rickbradley.com>]
2002
+
2003
+ * acts_as_list plays nicely with inheritance by remembering the class which declared it. #2811 [rephorm@rephorm.com]
2004
+
2005
+ * Fix sqlite adaptor's detection of missing dbfile or database declaration. [Nicholas Seckar]
2006
+
2007
+ * Fixed acts_as_list for definitions without an explicit :order #2803 [jonathan@bluewire.net.nz]
2008
+
2009
+ * Upgrade bundled ruby-mysql 0.2.4 with mysql411 shim (see #440) to ruby-mysql 0.2.6 with a patchset for 4.1 protocol support. Local change [301] is now a part of the main driver; reapplied local change [2182]. Removed GC.start from Result.free. [tommy@tmtm.org, akuroda@gmail.com, Doug Fales <doug.fales@gmail.com>, Jeremy Kemper]
2010
+
2011
+ * Correct handling of complex order clauses with SQL Server limit emulation. #2770 [Tom Ward <tom@popdog.net>, Matt B.]
2012
+
2013
+ * Correct whitespace problem in Oracle default column value parsing. #2788 [rick@rickbradley.com]
2014
+
2015
+ * Destroy associated has_and_belongs_to_many records after all before_destroy callbacks but before destroy. This allows you to act on the habtm association as you please while preserving referential integrity. #2065 [larrywilliams1@gmail.com, sam.kirchmeier@gmail.com, elliot@townx.org, Jeremy Kemper]
2016
+
2017
+ * Deprecate the old, confusing :exclusively_dependent option in favor of :dependent => :delete_all. [Jeremy Kemper]
2018
+
2019
+ * More compatible Oracle column reflection. #2771 [Ryan Davis <ryand-ruby@zenspider.com>, Michael Schoen <schoenm@earthlink.net>]
2020
+
2021
+
2022
+ *1.13.0* (November 7th, 2005)
2023
+
2024
+ * Fixed faulty regex in get_table_name method (SQLServerAdapter) #2639 [Ryan Tomayko]
2025
+
2026
+ * Added :include as an option for association declarations [DHH]. Example:
2027
+
2028
+ has_many :posts, :include => [ :author, :comments ]
2029
+
2030
+ * Rename Base.constrain to Base.with_scope so it doesn't conflict with existing concept of database constraints. Make scoping more robust: uniform method => parameters, validated method names and supported finder parameters, raise exception on nested scopes. [Jeremy Kemper] Example:
2031
+
2032
+ Comment.with_scope(:find => { :conditions => 'active=true' }, :create => { :post_id => 5 }) do
2033
+ # Find where name = ? and active=true
2034
+ Comment.find :all, :conditions => ['name = ?', name]
2035
+ # Create comment associated with :post_id
2036
+ Comment.create :body => "Hello world"
2037
+ end
2038
+
2039
+ * Fixed that SQL Server should ignore :size declarations on anything but integer and string in the agnostic schema representation #2756 [Ryan Tomayko]
2040
+
2041
+ * Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH]. Example:
2042
+
2043
+ Comment.constrain(:creation => { :post_id => 5 }) do
2044
+ # Associated with :post_id
2045
+ Comment.create :body => "Hello world"
2046
+ end
2047
+
2048
+ This is rarely used directly, but allows for find_or_create on associations. So you can do:
2049
+
2050
+ # If the tag doesn't exist, a new one is created that's associated with the person
2051
+ person.tags.find_or_create_by_name("Summer")
2052
+
2053
+ * Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH]. Example:
2054
+
2055
+ # No 'Summer' tag exists
2056
+ Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
2057
+
2058
+ # Now the 'Summer' tag does exist
2059
+ Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
2060
+
2061
+ * Added extension capabilities to has_many and has_and_belongs_to_many proxies [DHH]. Example:
2062
+
2063
+ class Account < ActiveRecord::Base
2064
+ has_many :people do
2065
+ def find_or_create_by_name(name)
2066
+ first_name, *last_name = name.split
2067
+ last_name = last_name.join " "
2068
+
2069
+ find_or_create_by_first_name_and_last_name(first_name, last_name)
2070
+ end
2071
+ end
2072
+ end
2073
+
2074
+ person = Account.find(:first).people.find_or_create_by_name("David Heinemeier Hansson")
2075
+ person.first_name # => "David"
2076
+ person.last_name # => "Heinemeier Hansson"
2077
+
2078
+ Note that the anoymous module must be declared using brackets, not do/end (due to order of evaluation).
2079
+
2080
+ * Omit internal dtproperties table from SQLServer table list. #2729 [rtomayko@gmail.com]
2081
+
2082
+ * Quote column names in generated SQL. #2728 [rtomayko@gmail.com]
2083
+
2084
+ * Correct the pure-Ruby MySQL 4.1.1 shim's version test. #2718 [Jeremy Kemper]
2085
+
2086
+ * Add Model.create! to match existing model.save! method. When save! raises RecordInvalid, you can catch the exception, retrieve the invalid record (invalid_exception.record), and see its errors (invalid_exception.record.errors). [Jeremy Kemper]
2087
+
2088
+ * Correct fixture behavior when table name pluralization is off. #2719 [Rick Bradley <rick@rickbradley.com>]
2089
+
2090
+ * Changed :dbfile to :database for SQLite adapter for consistency (old key still works as an alias) #2644 [Dan Peterson]
2091
+
2092
+ * Added migration support for Oracle #2647 [Michael Schoen]
2093
+
2094
+ * Worked around that connection can't be reset if allow_concurrency is off. #2648 [Michael Schoen <schoenm@earthlink.net>]
2095
+
2096
+ * Fixed SQL Server adapter to pass even more tests and do even better #2634 [rtomayko@gmail.com]
2097
+
2098
+ * Fixed SQL Server adapter so it honors options[:conditions] when applying :limits #1978 [Tom Ward]
2099
+
2100
+ * Added migration support to SQL Server adapter (please someone do the same for Oracle and DB2) #2625 [Tom Ward]
2101
+
2102
+ * Use AR::Base.silence rather than AR::Base.logger.silence in fixtures to preserve Log4r compatibility. #2618 [dansketcher@gmail.com]
2103
+
2104
+ * Constraints are cloned so they can't be inadvertently modified while they're
2105
+ in effect. Added :readonly finder constraint. Calling an association collection's class method (Part.foobar via item.parts.foobar) constrains :readonly => false since the collection's :joins constraint would otherwise force it to true. [Jeremy Kemper <rails@bitsweat.net>]
2106
+
2107
+ * Added :offset and :limit to the kinds of options that Base.constrain can use #2466 [duane.johnson@gmail.com]
2108
+
2109
+ * Fixed handling of nil number columns on Oracle and cleaned up tests for Oracle in general #2555 [schoenm@earthlink.net]
2110
+
2111
+ * Added quoted_true and quoted_false methods and tables to db2_adapter and cleaned up tests for DB2 #2493, #2624 [maik schmidt]
2112
+
2113
+
2114
+ *1.12.2* (October 26th, 2005)
2115
+
2116
+ * Allow symbols to rename columns when using SQLite adapter. #2531 [kevin.clark@gmail.com]
2117
+
2118
+ * Map Active Record time to SQL TIME. #2575, #2576 [Robby Russell <robby@planetargon.com>]
2119
+
2120
+ * Clarify semantics of ActiveRecord::Base#respond_to? #2560 [skaes@web.de]
2121
+
2122
+ * Fixed Association#clear for associations which have not yet been accessed. #2524 [Patrick Lenz <patrick@lenz.sh>]
2123
+
2124
+ * HABTM finders shouldn't return readonly records. #2525 [Patrick Lenz <patrick@lenz.sh>]
2125
+
2126
+ * Make all tests runnable on their own. #2521. [Blair Zajac <blair@orcaware.com>]
2127
+
2128
+
2129
+ *1.12.1* (October 19th, 2005)
2130
+
2131
+ * Always parenthesize :conditions options so they may be safely combined with STI and constraints.
2132
+
2133
+ * Correct PostgreSQL primary key sequence detection. #2507 [tmornini@infomania.com]
2134
+
2135
+ * Added support for using limits in eager loads that involve has_many and has_and_belongs_to_many associations
2136
+
2137
+
2138
+ *1.12.0* (October 16th, 2005)
2139
+
2140
+ * Update/clean up documentation (rdoc)
2141
+
2142
+ * PostgreSQL sequence support. Use set_sequence_name in your model class to specify its primary key sequence. #2292 [Rick Olson <technoweenie@gmail.com>, Robby Russell <robby@planetargon.com>]
2143
+
2144
+ * Change default logging colors to work on both white and black backgrounds. [Sam Stephenson]
2145
+
2146
+ * YAML fixtures support ordered hashes for fixtures with foreign key dependencies in the same table. #1896 [purestorm@ggnore.net]
2147
+
2148
+ * :dependent now accepts :nullify option. Sets the foreign key of the related objects to NULL instead of deleting them. #2015 [Robby Russell <robby@planetargon.com>]
2149
+
2150
+ * Introduce read-only records. If you call object.readonly! then it will mark the object as read-only and raise ReadOnlyRecord if you call object.save. object.readonly? reports whether the object is read-only. Passing :readonly => true to any finder method will mark returned records as read-only. The :joins option now implies :readonly, so if you use this option, saving the same record will now fail. Use find_by_sql to work around.
2151
+
2152
+ * Avoid memleak in dev mode when using fcgi
2153
+
2154
+ * Simplified .clear on active record associations by using the existing delete_records method. #1906 [Caleb <me@cpb.ca>]
2155
+
2156
+ * Delegate access to a customized primary key to the conventional id method. #2444. [Blair Zajac <blair@orcaware.com>]
2157
+
2158
+ * Fix errors caused by assigning a has-one or belongs-to property to itself
2159
+
2160
+ * Add ActiveRecord::Base.schema_format setting which specifies how databases should be dumped [Sam Stephenson]
2161
+
2162
+ * Update DB2 adapter. #2206. [contact@maik-schmidt.de]
2163
+
2164
+ * Corrections to SQLServer native data types. #2267. [rails.20.clarry@spamgourmet.com]
2165
+
2166
+ * Deprecated ActiveRecord::Base.threaded_connection in favor of ActiveRecord::Base.allow_concurrency.
2167
+
2168
+ * Protect id attribute from mass assigment even when the primary key is set to something else. #2438. [Blair Zajac <blair@orcaware.com>]
2169
+
2170
+ * Misc doc fixes (typos/grammar/etc.). #2430. [coffee2code]
2171
+
2172
+ * Add test coverage for content_columns. #2432. [coffee2code]
2173
+
2174
+ * Speed up for unthreaded environments. #2431. [skaes@web.de]
2175
+
2176
+ * Optimization for Mysql selects using mysql-ruby extension greater than 2.6.3. #2426. [skaes@web.de]
2177
+
2178
+ * Speed up the setting of table_name. #2428. [skaes@web.de]
2179
+
2180
+ * Optimize instantiation of STI subclass records. In partial fullfilment of #1236. [skaes@web.de]
2181
+
2182
+ * Fix typo of 'constrains' to 'contraints'. #2069. [Michael Schuerig <michael@schuerig.de>]
2183
+
2184
+ * Optimization refactoring for add_limit_offset!. In partial fullfilment of #1236. [skaes@web.de]
2185
+
2186
+ * Add ability to get all siblings, including the current child, with acts_as_tree. Recloses #2140. [Michael Schuerig <michael@schuerig.de>]
2187
+
2188
+ * Add geometric type for postgresql adapter. #2233 [akaspick@gmail.com]
2189
+
2190
+ * Add option (true by default) to generate reader methods for each attribute of a record to avoid the overhead of calling method missing. In partial fullfilment of #1236. [skaes@web.de]
2191
+
2192
+ * Add convenience predicate methods on Column class. In partial fullfilment of #1236. [skaes@web.de]
2193
+
2194
+ * Raise errors when invalid hash keys are passed to ActiveRecord::Base.find. #2363 [Chad Fowler <chad@chadfowler.com>, Nicholas Seckar]
2195
+
2196
+ * Added :force option to create_table that'll try to drop the table if it already exists before creating
2197
+
2198
+ * Fix transactions so that calling return while inside a transaction will not leave an open transaction on the connection. [Nicholas Seckar]
2199
+
2200
+ * Use foreign_key inflection uniformly. #2156 [Blair Zajac <blair@orcaware.com>]
2201
+
2202
+ * model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys. #2221 [joergd@pobox.com, ObieFernandez <obiefernandez@gmail.com>]
2203
+
2204
+ * Returning false from before_destroy should cancel the action. #1829 [Jeremy Huffman]
2205
+
2206
+ * Recognize PostgreSQL NOW() default as equivalent to CURRENT_TIMESTAMP or CURRENT_DATE, depending on the column's type. #2256 [mat <mat@absolight.fr>]
2207
+
2208
+ * Extensive documentation for the abstract database adapter. #2250 [François Beausoleil <fbeausoleil@ftml.net>]
2209
+
2210
+ * Clean up Fixtures.reset_sequences for PostgreSQL. Handle tables with no rows and models with custom primary keys. #2174, #2183 [jay@jay.fm, Blair Zajac <blair@orcaware.com>]
2211
+
2212
+ * Improve error message when nil is assigned to an attr which validates_size_of within a range. #2022 [Manuel Holtgrewe <purestorm@ggnore.net>]
2213
+
2214
+ * Make update_attribute use the same writer method that update_attributes uses.
2215
+ #2237 [trevor@protocool.com]
2216
+
2217
+ * Make migrations honor table name prefixes and suffixes. #2298 [Jakob S, Marcel Molina]
2218
+
2219
+ * Correct and optimize PostgreSQL bytea escaping. #1745, #1837 [dave@cherryville.org, ken@miriamtech.com, bellis@deepthought.org]
2220
+
2221
+ * Fixtures should only reset a PostgreSQL sequence if it corresponds to an integer primary key named id. #1749 [chris@chrisbrinker.com]
2222
+
2223
+ * Standardize the interpretation of boolean columns in the Mysql and Sqlite adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior)
2224
+
2225
+ * Added new symbol-driven approach to activating observers with Base#observers= [DHH]. Example:
2226
+
2227
+ ActiveRecord::Base.observers = :cacher, :garbage_collector
2228
+
2229
+ * Added AbstractAdapter#select_value and AbstractAdapter#select_values as convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283 [solo@gatelys.com]
2230
+
2231
+ * Wrap :conditions in parentheses to prevent problems with OR's #1871 [Jamis Buck]
2232
+
2233
+ * Allow the postgresql adapter to work with the SchemaDumper. [Jamis Buck]
2234
+
2235
+ * Add ActiveRecord::SchemaDumper for dumping a DB schema to a pure-ruby file, making it easier to consolidate large migration lists and port database schemas between databases. [Jamis Buck]
2236
+
2237
+ * Fixed migrations for Windows when using more than 10 [David Naseby]
2238
+
2239
+ * Fixed that the create_x method from belongs_to wouldn't save the association properly #2042 [Florian Weber]
2240
+
2241
+ * Fixed saving a record with two unsaved belongs_to associations pointing to the same object #2023 [Tobias Luetke]
2242
+
2243
+ * Improved migrations' behavior when the schema_info table is empty. [Nicholas Seckar]
2244
+
2245
+ * Fixed that Observers didn't observe sub-classes #627 [Florian Weber]
2246
+
2247
+ * Fix eager loading error messages, allow :include to specify tables using strings or symbols. Closes #2222 [Marcel Molina]
2248
+
2249
+ * Added check for RAILS_CONNECTION_ADAPTERS on startup and only load the connection adapters specified within if its present (available in Rails through config.connection_adapters using the new config) #1958 [skae]
2250
+
2251
+ * Fixed various problems with has_and_belongs_to_many when using customer finder_sql #2094 [Florian Weber]
2252
+
2253
+ * Added better exception error when unknown column types are used with migrations #1814 [fbeausoleil@ftml.net]
2254
+
2255
+ * Fixed "connection lost" issue with the bundled Ruby/MySQL driver (would kill the app after 8 hours of inactivity) #2163, #428 [kajism@yahoo.com]
2256
+
2257
+ * Fixed comparison of Active Record objects so two new objects are not equal #2099 [deberg]
2258
+
2259
+ * Fixed that the SQL Server adapter would sometimes return DBI::Timestamp objects instead of Time #2127 [Tom Ward]
2260
+
2261
+ * Added the instance methods #root and #ancestors on acts_as_tree and fixed siblings to not include the current node #2142, #2140 [coffee2code]
2262
+
2263
+ * Fixed that Active Record would call SHOW FIELDS twice (or more) for the same model when the cached results were available #1947 [sd@notso.net]
2264
+
2265
+ * Added log_level and use_silence parameter to ActiveRecord::Base.benchmark. The first controls at what level the benchmark statement will be logged (now as debug, instead of info) and the second that can be passed false to include all logging statements during the benchmark block/
2266
+
2267
+ * Make sure the schema_info table is created before querying the current version #1903
2268
+
2269
+ * Fixtures ignore table name prefix and suffix #1987 [Jakob S]
2270
+
2271
+ * Add documentation for index_type argument to add_index method for migrations #2005 [blaine@odeo.com]
2272
+
2273
+ * Modify read_attribute to allow a symbol argument #2024 [Ken Kunz]
2274
+
2275
+ * Make destroy return self #1913 [sebastian.kanthak@muehlheim.de]
2276
+
2277
+ * Fix typo in validations documentation #1938 [court3nay]
2278
+
2279
+ * Make acts_as_list work for insert_at(1) #1966 [hensleyl@papermountain.org]
2280
+
2281
+ * Fix typo in count_by_sql documentation #1969 [Alexey Verkhovsky]
2282
+
2283
+ * Allow add_column and create_table to specify NOT NULL #1712 [emptysands@gmail.com]
2284
+
2285
+ * Fix create_table so that id column is implicitly added [Rick Olson]
2286
+
2287
+ * Default sequence names for Oracle changed to #{table_name}_seq, which is the most commonly used standard. In addition, a new method ActiveRecord::Base#set_sequence_name allows the developer to set the sequence name per model. This is a non-backwards-compatible change -- anyone using the old-style "rails_sequence" will need to either create new sequences, or set: ActiveRecord::Base.set_sequence_name = "rails_sequence" #1798
2288
+
2289
+ * OCIAdapter now properly handles synonyms, which are commonly used to separate out the schema owner from the application user #1798
2290
+
2291
+ * Fixed the handling of camelCase columns names in Oracle #1798
2292
+
2293
+ * Implemented for OCI the Rakefile tasks of :clone_structure_to_test, :db_structure_dump, and :purge_test_database, which enable Oracle folks to enjoy all the agile goodness of Rails for testing. Note that the current implementation is fairly limited -- only tables and sequences are cloned, not constraints or indexes. A full clone in Oracle generally requires some manual effort, and is version-specific. Post 9i, Oracle recommends the use of the DBMS_METADATA package, though that approach requires editing of the physical characteristics generated #1798
2294
+
2295
+ * Fixed the handling of multiple blob columns in Oracle if one or more of them are null #1798
2296
+
2297
+ * Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke]
2298
+
2299
+ class Comment < AR:B
2300
+ def self.search(q)
2301
+ find(:all, :conditions => ["body = ?", q])
2302
+ end
2303
+ end
2304
+
2305
+ class Post < AR:B
2306
+ has_many :comments
2307
+ end
2308
+
2309
+ Post.find(1).comments.search('hi') # => SELECT * from comments WHERE post_id = 1 AND body = 'hi'
2310
+
2311
+ NOTICE: This patch changes the underlying SQL generated by has_and_belongs_to_many queries. If your relying on that, such as
2312
+ by explicitly referencing the old t and j aliases, you'll need to update your code. Of course, you _shouldn't_ be relying on
2313
+ details like that no less than you should be diving in to touch private variables. But just in case you do, consider yourself
2314
+ noticed :)
2315
+
2316
+ * Added migration support for SQLite (using temporary tables to simulate ALTER TABLE) #1771 [Sam Stephenson]
2317
+
2318
+ * Remove extra definition of supports_migrations? from abstract_adaptor.rb [Nicholas Seckar]
2319
+
2320
+ * Fix acts_as_list so that moving next-to-last item to the bottom does not result in duplicate item positions
2321
+
2322
+ * Fixed incompatibility in DB2 adapter with the new limit/offset approach #1718 [Maik Schmidt]
2323
+
2324
+ * Added :select option to find which can specify a different value than the default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes]
2325
+
2326
+
2327
+ *1.11.1* (11 July, 2005)
2328
+
2329
+ * Added support for limit and offset with eager loading of has_one and belongs_to associations. Using the options with has_many and has_and_belongs_to_many associations will now raise an ActiveRecord::ConfigurationError #1692 [Rick Olsen]
2330
+
2331
+ * Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
2332
+
2333
+ * Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
2334
+
2335
+ * Correct reflected table name for singular associations. #1688 [court3nay@gmail.com]
2336
+
2337
+ * Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
2338
+
2339
+ * Added ActiveRecord::Migrator.migrate that can figure out whether to go up or down based on the target version and the current
2340
+
2341
+ * Added better error message for "packets out of order" #1630 [courtenay]
2342
+
2343
+ * Fixed first run of "rake migrate" on PostgreSQL by not expecting a return value on the id #1640
2344
+
2345
+
2346
+ *1.11.0* (6 July, 2005)
2347
+
2348
+ * Fixed that Yaml error message in fixtures hid the real error #1623 [Nicholas Seckar]
2349
+
2350
+ * Changed logging of SQL statements to use the DEBUG level instead of INFO
2351
+
2352
+ * Added new Migrations framework for describing schema transformations in a way that can be easily applied across multiple databases #1604 [Tobias Luetke] See documentation under ActiveRecord::Migration and the additional support in the Rails rakefile/generator.
2353
+
2354
+ * Added callback hooks to association collections #1549 [Florian Weber]. Example:
2355
+
2356
+ class Project
2357
+ has_and_belongs_to_many :developers, :before_add => :evaluate_velocity
2358
+
2359
+ def evaluate_velocity(developer)
2360
+ ...
2361
+ end
2362
+ end
2363
+
2364
+ ..raising an exception will cause the object not to be added (or removed, with before_remove).
2365
+
2366
+
2367
+ * Fixed Base.content_columns call for SQL Server adapter #1450 [DeLynn Berry]
2368
+
2369
+ * Fixed Base#write_attribute to work with both symbols and strings #1190 [Paul Legato]
2370
+
2371
+ * Fixed that has_and_belongs_to_many didn't respect single table inheritance types #1081 [Florian Weber]
2372
+
2373
+ * Speed up ActiveRecord#method_missing for the common case (read_attribute).
2374
+
2375
+ * Only notify observers on after_find and after_initialize if these methods are defined on the model. #1235 [skaes@web.de]
2376
+
2377
+ * Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath]
2378
+
2379
+ * Fixed validates_numericality_of to work with overrided getter-method when :allow_nil is on #1316 [raidel@onemail.at]
2380
+
2381
+ * Added roots, root, and siblings to the batch of methods added by acts_as_tree #1541 [michael@schuerig.de]
2382
+
2383
+ * Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
2384
+
2385
+ * Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry]
2386
+
2387
+ * Fixed that multiparameter posts ignored attr_protected #1532 [alec+rails@veryclever.net]
2388
+
2389
+ * Fixed problem with eager loading when using a has_and_belongs_to_many association using :association_foreign_key #1504 [flash@vanklinkenbergsoftware.nl]
2390
+
2391
+ * Fixed Base#find to honor the documentation on how :joins work and make them consistent with Base#count #1405 [pritchie@gmail.com]. What used to be:
2392
+
2393
+ Developer.find :all, :joins => 'developers_projects', :conditions => 'id=developer_id AND project_id=1'
2394
+
2395
+ ...should instead be:
2396
+
2397
+ Developer.find(
2398
+ :all,
2399
+ :joins => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id',
2400
+ :conditions => 'project_id=1'
2401
+ )
2402
+
2403
+ * Fixed that validations didn't respecting custom setting for too_short, too_long messages #1437 [Marcel Molina]
2404
+
2405
+ * Fixed that clear_association_cache doesn't delete new associations on new records (so you can safely place new records in the session with Action Pack without having new associations wiped) #1494 [cluon]
2406
+
2407
+ * Fixed that calling Model.find([]) returns [] and doesn't throw an exception #1379
2408
+
2409
+ * Fixed that adding a record to a has_and_belongs_to collection would always save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid]
2410
+
2411
+ * Fixed saving of in-memory association structures to happen as a after_create/after_update callback instead of after_save -- that way you can add new associations in after_create/after_update callbacks without getting them saved twice
2412
+
2413
+ * Allow any Enumerable, not just Array, to work as bind variables #1344 [Jeremy Kemper]
2414
+
2415
+ * Added actual database-changing behavior to collection assigment for has_many and has_and_belongs_to_many #1425 [Sebastian Kanthak].
2416
+ Example:
2417
+
2418
+ david.projects = [Project.find(1), Project.new("name" => "ActionWebSearch")]
2419
+ david.save
2420
+
2421
+ If david.projects already contain the project with ID 1, this is left unchanged. Any other projects are dropped. And the new
2422
+ project is saved when david.save is called.
2423
+
2424
+ Also included is a way to do assignments through IDs, which is perfect for checkbox updating, so you get to do:
2425
+
2426
+ david.project_ids = [1, 5, 7]
2427
+
2428
+ * Corrected typo in find SQL for has_and_belongs_to_many. #1312 [ben@bensinclair.com]
2429
+
2430
+ * Fixed sanitized conditions for has_many finder method. #1281 [jackc@hylesanderson.com, pragdave, Tobias Luetke]
2431
+
2432
+ * Comprehensive PostgreSQL schema support. Use the optional schema_search_path directive in database.yml to give a comma-separated list of schemas to search for your tables. This allows you, for example, to have tables in a shared schema without having to use a custom table name. See http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html to learn more. #827 [dave@cherryville.org]
2433
+
2434
+ * Corrected @@configurations typo #1410 [david@ruppconsulting.com]
2435
+
2436
+ * Return PostgreSQL columns in the order they were declared #1374 [perlguy@gmail.com]
2437
+
2438
+ * Allow before/after update hooks to work on models using optimistic locking
2439
+
2440
+ * Eager loading of dependent has_one associations won't delete the association #1212
2441
+
2442
+ * Added a second parameter to the build and create method for has_one that controls whether the existing association should be replaced (which means nullifying its foreign key as well). By default this is true, but false can be passed to prevent it.
2443
+
2444
+ * Using transactional fixtures now causes the data to be loaded only once.
2445
+
2446
+ * Added fixture accessor methods that can be used when instantiated fixtures are disabled.
2447
+
2448
+ fixtures :web_sites
2449
+
2450
+ def test_something
2451
+ assert_equal "Ruby on Rails", web_sites(:rubyonrails).name
2452
+ end
2453
+
2454
+ * Added DoubleRenderError exception that'll be raised if render* is called twice #518 [Nicholas Seckar]
2455
+
2456
+ * Fixed exceptions occuring after render has been called #1096 [Nicholas Seckar]
2457
+
2458
+ * CHANGED: validates_presence_of now uses Errors#add_on_blank, which will make " " fail the validation where it didn't before #1309
2459
+
2460
+ * Added Errors#add_on_blank which works like Errors#add_on_empty, but uses Object#blank? instead
2461
+
2462
+ * Added the :if option to all validations that can either use a block or a method pointer to determine whether the validation should be run or not. #1324 [Duane Johnson/jhosteny]. Examples:
2463
+
2464
+ Conditional validations such as the following are made possible:
2465
+ validates_numericality_of :income, :if => :employed?
2466
+
2467
+ Conditional validations can also solve the salted login generator problem:
2468
+ validates_confirmation_of :password, :if => :new_password?
2469
+
2470
+ Using blocks:
2471
+ validates_presence_of :username, :if => Proc.new { |user| user.signup_step > 1 }
2472
+
2473
+ * Fixed use of construct_finder_sql when using :join #1288 [dwlt@dwlt.net]
2474
+
2475
+ * Fixed that :delete_sql in has_and_belongs_to_many associations couldn't access record properties #1299 [Rick Olson]
2476
+
2477
+ * Fixed that clone would break when an aggregate had the same name as one of its attributes #1307 [Jeremy Kemper]
2478
+
2479
+ * Changed that destroying an object will only freeze the attributes hash, which keeps the object from having attributes changed (as that wouldn't make sense), but allows for the querying of associations after it has been destroyed.
2480
+
2481
+ * Changed the callbacks such that observers are notified before the in-object callbacks are triggered. Without this change, it wasn't possible to act on the whole object in something like a before_destroy observer without having the objects own callbacks (like deleting associations) called first.
2482
+
2483
+ * Added option for passing an array to the find_all version of the dynamic finders and have it evaluated as an IN fragment. Example:
2484
+
2485
+ # SELECT * FROM topics WHERE title IN ('First', 'Second')
2486
+ Topic.find_all_by_title(["First", "Second"])
2487
+
2488
+ * Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
2489
+
2490
+ * Fixed extraneous comma in count() function that made it not work with joins #1156 [jarkko/Dee.Zsombor]
2491
+
2492
+ * Fixed incompatibility with Base#find with an array of ids that would fail when using eager loading #1186 [Alisdair McDiarmid]
2493
+
2494
+ * Fixed that validate_length_of lost :on option when :within was specified #1195 [jhosteny@mac.com]
2495
+
2496
+ * Added encoding and min_messages options for PostgreSQL #1205 [shugo]. Configuration example:
2497
+
2498
+ development:
2499
+ adapter: postgresql
2500
+ database: rails_development
2501
+ host: localhost
2502
+ username: postgres
2503
+ password:
2504
+ encoding: UTF8
2505
+ min_messages: ERROR
2506
+
2507
+ * Fixed acts_as_list where deleting an item that was removed from the list would ruin the positioning of other list items #1197 [Jamis Buck]
2508
+
2509
+ * Added validates_exclusion_of as a negative of validates_inclusion_of
2510
+
2511
+ * Optimized counting of has_many associations by setting the association to empty if the count is 0 so repeated calls doesn't trigger database calls
2512
+
2513
+
2514
+ *1.10.1* (20th April, 2005)
2515
+
2516
+ * Fixed frivilous database queries being triggered with eager loading on empty associations and other things
2517
+
2518
+ * Fixed order of loading in eager associations
2519
+
2520
+ * Fixed stray comma when using eager loading and ordering together from has_many associations #1143
2521
+
2522
+
2523
+ *1.10.0* (19th April, 2005)
2524
+
2525
+ * Added eager loading of associations as a way to solve the N+1 problem more gracefully without piggy-back queries. Example:
2526
+
2527
+ for post in Post.find(:all, :limit => 100)
2528
+ puts "Post: " + post.title
2529
+ puts "Written by: " + post.author.name
2530
+ puts "Last comment on: " + post.comments.first.created_on
2531
+ end
2532
+
2533
+ This used to generate 301 database queries if all 100 posts had both author and comments. It can now be written as:
2534
+
2535
+ for post in Post.find(:all, :limit => 100, :include => [ :author, :comments ])
2536
+
2537
+ ...and the number of database queries needed is now 1.
2538
+
2539
+ * Added new unified Base.find API and deprecated the use of find_first and find_all. See the documentation for Base.find. Examples:
2540
+
2541
+ Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
2542
+ Person.find(1, 5, 6, :conditions => "administrator = 1", :order => "created_on DESC")
2543
+ Person.find(:first, :order => "created_on DESC", :offset => 5)
2544
+ Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
2545
+ Person.find(:all, :offset => 10, :limit => 10)
2546
+
2547
+ * Added acts_as_nested_set #1000 [wschenk]. Introduction:
2548
+
2549
+ This acts provides Nested Set functionality. Nested Set is similiar to Tree, but with
2550
+ the added feature that you can select the children and all of it's descendants with
2551
+ a single query. A good use case for this is a threaded post system, where you want
2552
+ to display every reply to a comment without multiple selects.
2553
+
2554
+ * Added Base.save! that attempts to save the record just like Base.save but will raise a RecordInvalid exception instead of returning false if the record is not valid [After much pestering from Dave Thomas]
2555
+
2556
+ * Fixed PostgreSQL usage of fixtures with regards to public schemas and table names with dots #962 [gnuman1@gmail.com]
2557
+
2558
+ * Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com]
2559
+
2560
+ * Fixed loading of fixtures in to be in the right order (or PostgreSQL would bark) #1047 [stephenh@chase3000.com]
2561
+
2562
+ * Fixed page caching for non-vhost applications living underneath the root #1004 [Ben Schumacher]
2563
+
2564
+ * Fixes a problem with the SQL Adapter which was resulting in IDENTITY_INSERT not being set to ON when it should be #1104 [adelle]
2565
+
2566
+ * Added the option to specify the acceptance string in validates_acceptance_of #1106 [caleb@aei-tech.com]
2567
+
2568
+ * Added insert_at(position) to acts_as_list #1083 [DeLynnB]
2569
+
2570
+ * Removed the default order by id on has_and_belongs_to_many queries as it could kill performance on large sets (you can still specify by hand with :order)
2571
+
2572
+ * Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
2573
+
2574
+ * Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
2575
+
2576
+ * Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
2577
+
2578
+ * Added rollbacks of transactions if they're active as the dispatcher is killed gracefully (TERM signal) #1054 [Leon Bredt]
2579
+
2580
+ * Added quoting of column names for fixtures #997 [jcfischer@gmail.com]
2581
+
2582
+ * Fixed counter_sql when no records exist in database for PostgreSQL (would give error, not 0) #1039 [Caleb Tennis]
2583
+
2584
+ * Fixed that benchmarking times for rendering included db runtimes #987 [skaes@web.de]
2585
+
2586
+ * Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]
2587
+
2588
+ * Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [Jeremy Kemper]
2589
+
2590
+ * Fixed auto-stamping of dates (created_on/updated_on) for PostgreSQL #985 [dave@cherryville.org]
2591
+
2592
+ * Fixed Base.silence/benchmark to only log if a logger has been configured #986 [skaes@web.de]
2593
+
2594
+ * Added a join parameter as the third argument to Base.find_first and as the second to Base.count #426, #988 [skaes@web.de]
2595
+
2596
+ * Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
2597
+
2598
+ * Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
2599
+
2600
+
2601
+ *1.9.1* (27th March, 2005)
2602
+
2603
+ * Fixed that Active Record objects with float attribute could not be cloned #808
2604
+
2605
+ * Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
2606
+
2607
+ * Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
2608
+
2609
+ * Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
2610
+
2611
+ * Fixed the MS SQL adapter to work with the new limit/offset approach and with binary data (still suffering from 7KB limit, though) #901 [delynnb]
2612
+
2613
+
2614
+ *1.9.0* (22th March, 2005)
2615
+
2616
+ * Added adapter independent limit clause as a two-element array with the first being the limit, the second being the offset #795 [Sam Stephenson]. Example:
2617
+
2618
+ Developer.find_all nil, 'id ASC', 5 # return the first five developers
2619
+ Developer.find_all nil, 'id ASC', [3, 8] # return three developers, starting from #8 and forward
2620
+
2621
+ This doesn't yet work with the DB2 or MS SQL adapters. Patches to make that happen are encouraged.
2622
+
2623
+ * Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson]
2624
+
2625
+ * Improved the performance of the OCI8 adapter for Oracle #723 [pilx/gjenkins]
2626
+
2627
+ * Added type conversion before saving a record, so string-based values like "10.0" aren't left for the database to convert #820 [dave@cherryville.org]
2628
+
2629
+ * Added with additional settings for working with transactional fixtures and pre-loaded test databases #865 [mindel]
2630
+
2631
+ * Fixed acts_as_list to trigger remove_from_list on destroy after the fact, not before, so a unique position can be maintained #871 [Alisdair McDiarmid]
2632
+
2633
+ * Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]
2634
+
2635
+ * Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net]
2636
+
2637
+ * Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak]
2638
+
2639
+ * Fixed problem with using slashes in validates_format_of regular expressions #801 [Sebastian Kanthak]
2640
+
2641
+ * Fixed that SQLite3 exceptions are caught and reported properly #823 [yerejm]
2642
+
2643
+ * Added that all types of after_find/after_initialized callbacks are triggered if the explicit implementation is present, not only the explicit implementation itself
2644
+
2645
+ * Fixed that symbols can be used on attribute assignment, like page.emails.create(:subject => data.subject, :body => data.body)
2646
+
2647
+
2648
+ *1.8.0* (7th March, 2005)
2649
+
2650
+ * Added ActiveRecord::Base.colorize_logging to control whether to use colors in logs or not (on by default)
2651
+
2652
+ * Added support for timestamp with time zone in PostgreSQL #560 [Scott Barron]
2653
+
2654
+ * Added MultiparameterAssignmentErrors and AttributeAssignmentError exceptions #777 [demetrius]. Documentation:
2655
+
2656
+ * +MultiparameterAssignmentErrors+ -- collection of errors that occurred during a mass assignment using the
2657
+ +attributes=+ method. The +errors+ property of this exception contains an array of +AttributeAssignmentError+
2658
+ objects that should be inspected to determine which attributes triggered the errors.
2659
+ * +AttributeAssignmentError+ -- an error occurred while doing a mass assignment through the +attributes=+ method.
2660
+ You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
2661
+
2662
+ * Fixed that postgresql adapter would fails when reading bytea fields with null value #771 [rodrigo k]
2663
+
2664
+ * Added transactional fixtures that uses rollback to undo changes to fixtures instead of DELETE/INSERT -- it's much faster. See documentation under Fixtures #760 [Jeremy Kemper]
2665
+
2666
+ * Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]. Example:
2667
+
2668
+ class Account < ActiveRecord::Base
2669
+ has_one :credit_card, :dependent => true
2670
+ end
2671
+ class CreditCard < ActiveRecord::Base
2672
+ belongs_to :account
2673
+ end
2674
+
2675
+ account.credit_card # => returns existing credit card, lets say id = 12
2676
+ account.credit_card = CreditCard.create("number" => "123")
2677
+ account.save # => CC with id = 12 is destroyed
2678
+
2679
+
2680
+ * Added validates_numericality_of #716 [skanthak/c.r.mcgrath]. Docuemntation:
2681
+
2682
+ Validates whether the value of the specified attribute is numeric by trying to convert it to
2683
+ a float with Kernel.Float (if <tt>integer</tt> is false) or applying it to the regular expression
2684
+ <tt>/^[\+\-]?\d+$/</tt> (if <tt>integer</tt> is set to true).
2685
+
2686
+ class Person < ActiveRecord::Base
2687
+ validates_numericality_of :value, :on => :create
2688
+ end
2689
+
2690
+ Configuration options:
2691
+ * <tt>message</tt> - A custom error message (default is: "is not a number")
2692
+ * <tt>on</tt> Specifies when this validation is active (default is :save, other options :create, :update)
2693
+ * <tt>only_integer</tt> Specifies whether the value has to be an integer, e.g. an integral value (default is false)
2694
+
2695
+
2696
+ * Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
2697
+
2698
+ * 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)
2699
+
2700
+ * Added MacroReflection#macro which will return a symbol describing the macro used (like :composed_of or :has_many) #718, #248 [james@slashetc.com]
2701
+
2702
+
2703
+ *1.7.0* (24th February, 2005)
2704
+
2705
+ * 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]
2706
+
2707
+ * Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Usage notes:
2708
+
2709
+ 1. Key generation uses a sequence "rails_sequence" for all tables. (I couldn't find a simple
2710
+ and safe way of passing table-specific sequence information to the adapter.)
2711
+ 2. Oracle uses DATE or TIMESTAMP datatypes for both dates and times. Consequently I have had to
2712
+ resort to some hacks to get data converted to Date or Time in Ruby.
2713
+ If the column_name ends in _at (like created_at, updated_at) it's created as a Ruby Time. Else if the
2714
+ hours/minutes/seconds are 0, I make it a Ruby Date. Else it's a Ruby Time.
2715
+ This is nasty - but if you use Duck Typing you'll probably not care very much.
2716
+ In 9i it's tempting to map DATE to Date and TIMESTAMP to Time but I don't think that is
2717
+ valid - too many databases use DATE for both.
2718
+ Timezones and sub-second precision on timestamps are not supported.
2719
+ 3. Default values that are functions (such as "SYSDATE") are not supported. This is a
2720
+ restriction of the way active record supports default values.
2721
+ 4. Referential integrity constraints are not fully supported. Under at least
2722
+ some circumstances, active record appears to delete parent and child records out of
2723
+ sequence and out of transaction scope. (Or this may just be a problem of test setup.)
2724
+
2725
+ The OCI8 driver can be retrieved from http://rubyforge.org/projects/ruby-oci8/
2726
+
2727
+ * Added option :schema_order to the PostgreSQL adapter to support the use of multiple schemas per database #697 [YuriSchimke]
2728
+
2729
+ * Optimized the SQL used to generate has_and_belongs_to_many queries by listing the join table first #693 [yerejm]
2730
+
2731
+ * 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]
2732
+
2733
+ * Fixed that Active Record would throw Broken Pipe errors with FCGI when the MySQL connection timed out instead of reconnecting #428 [Nicholas Seckar]
2734
+
2735
+ * 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]
2736
+
2737
+ * Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
2738
+
2739
+ * Fixed that find_by_* would fail when column names had numbers #670 [demetrius]
2740
+
2741
+ * Fixed the SQL Server adapter on a bunch of issues #667 [DeLynn]
2742
+
2743
+ 1. Created a new columns method that is much cleaner.
2744
+ 2. Corrected a problem with the select and select_all methods
2745
+ that didn't account for the LIMIT clause being passed into raw SQL statements.
2746
+ 3. Implemented the string_to_time method in order to create proper instances of the time class.
2747
+ 4. Added logic to the simplified_type method that allows the database to specify the scale of float data.
2748
+ 5. Adjusted the quote_column_name to account for the fact that MS SQL is bothered by a forward slash in the data string.
2749
+
2750
+ * Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
2751
+
2752
+ * Added validates_each that validates each specified attribute against a block #610 [Jeremy Kemper]. Example:
2753
+
2754
+ class Person < ActiveRecord::Base
2755
+ validates_each :first_name, :last_name do |record, attr|
2756
+ record.errors.add attr, 'starts with z.' if attr[0] == ?z
2757
+ end
2758
+ end
2759
+
2760
+ * 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 [Jeremy Kemper]
2761
+
2762
+ * Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
2763
+
2764
+ class Person < ActiveRecord::Base
2765
+ validate { |person| person.errors.add("title", "will never be valid") if SHOULD_NEVER_BE_VALID }
2766
+ end
2767
+
2768
+ * Addded validation for validate all the associated objects before declaring failure with validates_associated #618 [Tim Bates]
2769
+
2770
+ * Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]. Example:
2771
+
2772
+ class Project < ActiveRecord::Base
2773
+ primary_key "sysid"
2774
+ table_name "XYZ_PROJECT"
2775
+ inheritance_column { original_inheritance_column + "_id" }
2776
+ end
2777
+
2778
+ * Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
2779
+
2780
+
2781
+ *1.6.0* (January 25th, 2005)
2782
+
2783
+ * 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.
2784
+
2785
+ * Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336
2786
+
2787
+ * Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once.
2788
+
2789
+ * 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
2790
+
2791
+ people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
2792
+ Person.update(people.keys, people.values)
2793
+
2794
+ * 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]
2795
+
2796
+ * Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
2797
+
2798
+ * Fixed that the dynamic finders didn't treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
2799
+
2800
+ * Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [Jeremy Kemper]
2801
+
2802
+ * 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]
2803
+
2804
+ * 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]
2805
+
2806
+ * Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
2807
+
2808
+ * Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
2809
+
2810
+ * Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
2811
+
2812
+ * Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
2813
+
2814
+
2815
+ *1.5.1* (January 18th, 2005)
2816
+
2817
+ * 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]
2818
+
2819
+ * Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
2820
+
2821
+
2822
+ *1.5.0* (January 17th, 2005)
2823
+
2824
+ * Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
2825
+
2826
+ * Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]. Example:
2827
+
2828
+ class Book < ActiveRecord::Base
2829
+ has_many :pages
2830
+ belongs_to :library
2831
+
2832
+ validates_associated :pages, :library
2833
+ end
2834
+
2835
+ * Added support for associating unsaved objects #402 [Tim Bates]. Rules that govern this addition:
2836
+
2837
+ == Unsaved objects and associations
2838
+
2839
+ You can manipulate objects and associations before they are saved to the database, but there is some special behaviour you should be
2840
+ aware of, mostly involving the saving of associated objects.
2841
+
2842
+ === One-to-one associations
2843
+
2844
+ * Assigning an object to a has_one association automatically saves that object, and the object being replaced (if there is one), in
2845
+ order to update their primary keys - except if the parent object is unsaved (new_record? == true).
2846
+ * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns false and the assignment
2847
+ is cancelled.
2848
+ * If you wish to assign an object to a has_one association without saving it, use the #association.build method (documented below).
2849
+ * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does
2850
+ not save the parent either.
2851
+
2852
+ === Collections
2853
+
2854
+ * Adding an object to a collection (has_many or has_and_belongs_to_many) automatically saves that object, except if the parent object
2855
+ (the owner of the collection) is not yet stored in the database.
2856
+ * If saving any of the objects being added to a collection (via #push or similar) fails, then #push returns false.
2857
+ * You can add an object to a collection without automatically saving it by using the #collection.build method (documented below).
2858
+ * All unsaved (new_record? == true) members of the collection are automatically saved when the parent is saved.
2859
+
2860
+ * Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
2861
+
2862
+ * Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
2863
+
2864
+ * 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]
2865
+
2866
+ * Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
2867
+
2868
+ * Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
2869
+
2870
+ * Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the
2871
+ collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If
2872
+ it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards,
2873
+ it'll take one less SELECT query if you use length.
2874
+
2875
+ * 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]
2876
+
2877
+ * Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
2878
+
2879
+ * Fixed default scope of acts_as_list from "1" to "1 = 1", so it'll work in PostgreSQL (among other places) #427 [Alexey]
2880
+
2881
+ * Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
2882
+
2883
+ * Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [Jeremy Kemper]
2884
+
2885
+ * 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]
2886
+
2887
+ * Added that Observers can use the observes class method instead of overwriting self.observed_class().
2888
+
2889
+ Before:
2890
+ class ListSweeper < ActiveRecord::Base
2891
+ def self.observed_class() [ List, Item ]
2892
+ end
2893
+
2894
+ After:
2895
+ class ListSweeper < ActiveRecord::Base
2896
+ observes List, Item
2897
+ end
2898
+
2899
+ * Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
2900
+
2901
+ * Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
2902
+
2903
+ * Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag.
2904
+
2905
+ Before: topic.update_attribute(:approved, !approved?)
2906
+ After : topic.toggle!(:approved)
2907
+
2908
+ * Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Example:
2909
+
2910
+ page.views # => 1
2911
+ page.increment!(:views) # executes an UPDATE statement
2912
+ page.views # => 2
2913
+
2914
+ page.increment(:views).increment!(:views)
2915
+ page.views # => 4
2916
+
2917
+ * Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
2918
+
2919
+
2920
+
2921
+
2922
+ *1.14.2* (April 9th, 2005)
2923
+
2924
+ * Fixed calculations for the Oracle Adapter (closes #4626) [Michael Schoen]
2925
+
2926
+
507
2927
  *1.14.1* (April 6th, 2006)
508
2928
 
509
2929
  * Fix type_name_with_module to handle type names that begin with '::'. Closes #4614. [Nicholas Seckar]