Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 442 lines (275 sloc) 13.388 kb
0fb6bbd @rafaelfranca Merge pull request #7140 from seamusabshere/patch-1
rafaelfranca authored
1 ## Rails 3.2.9 (unreleased)
6abe0e7 @rafaelfranca Backport explain fixes.
rafaelfranca authored
2
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
3 * The postgres adapter now supports tables with capital letters.
4 Fix #5920
5
6 *Yves Senn*
7
8 * `CollectionAssociation#count` returns `0` without querying if the
9 parent record is not persisted.
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
10
11 Before:
12
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
13 person.pets.count
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
14 # SELECT COUNT(*) FROM "pets" WHERE "pets"."person_id" IS NULL
15 # => 0
16
17 After:
18
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
19 person.pets.count
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
20 # fires without sql query
21 # => 0
22
23 *Francesco Rodriguez*
24
3f0bc97 @rafaelfranca Merge pull request #7822 from lulalala/reset-counter-cache-for-has-ma…
rafaelfranca authored
25 * Fix `reset_counters` crashing on `has_many :through` associations.
26 Fix #7822.
27
28 *lulalala*
29
3908706 @jrochkind ConnectionPool accepts spec key 'checkout_timeout'
jrochkind authored
30 * ConnectionPool recognizes checkout_timeout spec key as taking
31 precedence over legacy wait_timeout spec key, can be used to avoid
32 conflict with mysql2 use of wait_timeout. Closes #7684.
33
34 *jrochkind*
35
b8fba55 @tenderlove Merge pull request #3544 from amatsuda/_field_changed
tenderlove authored
36 * Rename field_changed? to _field_changed? so that users can create a field named field
37
38 *Akira Matsuda*, backported by *Steve Klabnik*
39
ee43989 @rafaelfranca Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt
rafaelfranca authored
40 * Fix creation of through association models when using `collection=[]`
41 on a `has_many :through` association from an unsaved model.
42 Fix #7661.
43
44 *Ernie Miller*
45
6abe0e7 @rafaelfranca Backport explain fixes.
rafaelfranca authored
46 * Explain only normal CRUD sql (select / update / insert / delete).
47 Fix problem that explains unexplainable sql. Closes #7544 #6458.
48
49 *kennyj*
50
f48bb01 Backport PostgreSQL auto-reconnect test coverage
Steve Jorgensen authored
51 * Backport test coverage to ensure that PostgreSQL auto-reconnect functionality
52 remains healthy.
53
2326d46 fix markdown markup in AR/CHANGELOG
Francesco Rodríguez authored
54 *Steve Jorgensen*
f48bb01 Backport PostgreSQL auto-reconnect test coverage
Steve Jorgensen authored
55
9630485 @kennyj Backported #7572 to 3-2-stable. Use config['encoding'], because datab…
kennyj authored
56 * Use config['encoding'] instead of config['charset'] when executing
57 databases.rake in the mysql/mysql2. A correct option for a database.yml
58 is 'encoding'.
59
60 *kennyj*
61
652107e @tchandy ConnectionAdapters::Column.type_cast_code should always convert value…
tchandy authored
62 * Fix ConnectionAdapters::Column.type_cast_code integer conversion,
63 to always convert values to integer calling #to_i. Fixes #7509.
64
65 *Thiago Pradi*
0fb6bbd @rafaelfranca Merge pull request #7140 from seamusabshere/patch-1
rafaelfranca authored
66
5054e26 @rafaelfranca Merge pull request #7337 from adzap/string_to_dummy_time
rafaelfranca authored
67 * Fix time column type casting for invalid time string values to correctly return nil.
68
69 *Adam Meehan*
70
01d09a6 @senny set the configured #inheritance_column on #become (#7503)
senny authored
71 * Fix `becomes` when using a configured `inheritance_column`.
72
73 *Yves Senn*
74
648c5a1 @rafaelfranca Merge pull request #5210 from Pliny/masteri
rafaelfranca authored
75 * Fix `reset_counters` when there are multiple `belongs_to` association with the
76 same foreign key and one of them have a counter cache.
77 Fixes #5200.
78
79 *Dave Desrochers*
80
8905c1f @rafaelfranca Merge pull request #6986 from kennyj/fix_6975
rafaelfranca authored
81 * Round usec when comparing timestamp attributes in the dirty tracking.
82 Fixes #6975.
83
84 *kennyj*
85
fdf4eae @carlosantoniodasilva Merge pull request #7377 from brainopia/use_inversed_parent_for_first…
carlosantoniodasilva authored
86 * Use inversed parent for first and last child of has_many association.
87
88 *Ravil Bayramgalin*
89
d6dbd7f @rafaelfranca Merge pull request #7352 from aripollak/microsecond-timestamp
rafaelfranca authored
90 * Fix Column.microseconds and Column.fast_string_to_date to avoid converting
91 timestamp seconds to a float, since it occasionally results in inaccuracies
92 with microsecond-precision times. Fixes #7352.
93
94 *Ari Pollak*
95
8055cd6 @rafaelfranca Do not use update_column where update_attribute is not interchangeable
rafaelfranca authored
96 * Fix `increment!`, `decrement!`, `toggle!` that was skipping callbacks.
97 Fixes #7306.
98
99 *Rafael Mendonça França*
100
786713a @rafaelfranca Merge pull request #6073 from daveyeu/restore-state-on-record-invalid
rafaelfranca authored
101 * Fix AR#create to return an unsaved record when AR::RecordInvalid is
102 raised. Fixes #3217.
103
104 *Dave Yeu*
105
3307a2e @rafaelfranca Add CHANGELOG entry for #7286
rafaelfranca authored
106 * Remove unnecessary transaction when assigning has_one associations with a nil or equal value.
107 Fix #7191.
108
109 *kennyj*
110
5c2fc69 @rafaelfranca Add CHANGELOG entry
rafaelfranca authored
111 * Allow store to work with an empty column.
112 Fix #4840.
113
114 *Jeremy Walker*
115
ea48732 @rafaelfranca Add CHANGELOG entry for a935c7a
rafaelfranca authored
116 * Remove prepared statement from system query in postgresql adapter.
117 Fix #5872.
118
119 *Ivan Evtuhovich*
120
0fb6bbd @rafaelfranca Merge pull request #7140 from seamusabshere/patch-1
rafaelfranca authored
121 * Make sure `:environment` task is executed before `db:schema:load` or `db:structure:load`
122 Fixes #4772.
123
124 *Seamus Abshere*
125
126
ddedf5d @spastorino Add release date to CHANGELOGs
spastorino authored
127 ## Rails 3.2.8 (Aug 9, 2012) ##
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
128
55e05d4 @rafaelfranca Do not consider the numeric attribute as changed if the old value is
rafaelfranca authored
129 * Do not consider the numeric attribute as changed if the old value is zero and the new value
130 is not a string.
131 Fixes #7237.
132
133 *Rafael Mendonça França*
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
134
81542f9 @fxn removes the deprecation of update_attribute
fxn authored
135 * Removes the deprecation of `update_attribute`. *fxn*
136
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
137 * Reverted the deprecation of `composed_of`. *Rafael Mendonça França*
138
0c52702 @jonleighton Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql."
jonleighton authored
139 * Reverted the deprecation of `*_sql` association options. They will
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
140 be deprecated in 4.0 instead. *Jon Leighton*
141
142 * Do not eager load AR session store. ActiveRecord::SessionStore depends on the abstract store
143 in Action Pack. Eager loading this class would break client code that eager loads Active Record
144 standalone.
145 Fixes #7160
0c52702 @jonleighton Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql."
jonleighton authored
146
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
147 *Xavier Noria*
6764b7b @spastorino Add missing CHANGELOG entries
spastorino authored
148
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
149 * Do not set RAILS_ENV to "development" when using `db:test:prepare` and related rake tasks.
150 This was causing the truncation of the development database data when using RSpec.
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
151 Fixes #7175.
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
152
153 *Rafael Mendonça França*
154
d1b9cf2 @tenderlove updating release date
tenderlove authored
155 ## Rails 3.2.7 (Jul 26, 2012) ##
2109fd5 @fxn registers the deprecation of update_attribute in the CHANGELOG
fxn authored
156
a79bfa9 @jonleighton Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql.
jonleighton authored
157 * `:finder_sql` and `:counter_sql` options on collection associations
158 are deprecated. Please transition to using scopes.
159
160 *Jon Leighton*
161
162 * `:insert_sql` and `:delete_sql` options on `has_and_belongs_to_many`
163 associations are deprecated. Please transition to using `has_many
164 :through`
165
166 *Jon Leighton*
167
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
168 * `composed_of` has been deprecated. You'll have to write your own accessor
169 and mutator methods if you'd like to use value objects to represent some
170 portion of your models.
171
172 *Steve Klabnik*
173
2f930df @rafaelfranca Revert "Add update_columns and the suggestion of using update_columns
rafaelfranca authored
174 * `update_attribute` has been deprecated. Use `update_column` if
2109fd5 @fxn registers the deprecation of update_attribute in the CHANGELOG
fxn authored
175 you want to bypass mass-assignment protection, validations, callbacks,
176 and touching of updated_at. Otherwise please use `update_attributes`.
177
178 *Steve Klabnik*
179
8381d39 @tenderlove updating changelogs
tenderlove authored
180 ## Rails 3.2.6 (Jun 12, 2012) ##
959fb8e @jonleighton Revert "Perf: Don't load the association for #delete_all."
jonleighton authored
181
ceb8ec3 @tenderlove updating changelogs with security fixes
tenderlove authored
182 * protect against the nesting of hashes changing the
183 table context in the next call to build_from_hash. This fix
184 covers this case as well.
185
8381d39 @tenderlove updating changelogs
tenderlove authored
186 CVE-2012-2695
187
959fb8e @jonleighton Revert "Perf: Don't load the association for #delete_all."
jonleighton authored
188 * Revert earlier 'perf fix' (see 3.2.4 changelog / GH #6289). This
189 change introduced a regression (GH #6609). assoc.clear and
190 assoc.delete_all have loaded the association before doing the delete
191 since at least Rails 2.3. Doing the delete without loading the
192 records means that the `before_remove` and `after_remove` callbacks do
193 not get invoked. Therefore, this change was less a fix a more an
194 optimisation, which should only have gone into master.
195
196 *Jon Leighton*
197
b13d89e @rafaelfranca Add release date of 3.2.5 on the CHANGELOG
rafaelfranca authored
198 ## Rails 3.2.5 (Jun 1, 2012) ##
199
200 * Restore behavior of Active Record 3.2.3 scopes.
201 A series of commits relating to preloading and scopes caused a regression.
202
203 *Andrew White*
204
205
d3e5d1c @tenderlove updating changelogs
tenderlove authored
206 ## Rails 3.2.4 (May 31, 2012) ##
2c21a2f @benedikt Revert "Revert "Fix #5667. Preloading should ignore scoping.""
benedikt authored
207
b98d1e2 @jonleighton Perf: Don't load the association for #delete_all.
jonleighton authored
208 * Perf fix: Don't load the records when doing assoc.delete_all.
209 GH #6289. *Jon Leighton*
210
2c21a2f @benedikt Revert "Revert "Fix #5667. Preloading should ignore scoping.""
benedikt authored
211 * Association preloading shouldn't be affected by the current scoping.
212 This could cause infinite recursion and potentially other problems.
213 See GH #5667. *Jon Leighton*
214
d3e5d1c @tenderlove updating changelogs
tenderlove authored
215 * Datetime attributes are forced to be changed. GH #3965
216
217 * Fix attribute casting. GH #5549
218
219 * Fix #5667. Preloading should ignore scoping.
220
44aca7b @tenderlove adding security notifications to CHANGELOGs
tenderlove authored
221 * Predicate builder should not recurse for determining where columns.
222 Thanks to Ben Murphy for reporting this! CVE-2012-2661
223
b13d89e @rafaelfranca Add release date of 3.2.5 on the CHANGELOG
rafaelfranca authored
224
3005f58 @rafaelfranca Add release data to Rails 3.2.3
rafaelfranca authored
225 ## Rails 3.2.3 (March 30, 2012) ##
3bfd651 @vijaydev changelog updates [ci skip]
vijaydev authored
226
90d9635 @pixeltrix Add dynamic find_or_create_by_{attribute}! method.
pixeltrix authored
227 * Added find_or_create_by_{attribute}! dynamic method. *Andrew White*
228
3bfd651 @vijaydev changelog updates [ci skip]
vijaydev authored
229 * Whitelist all attribute assignment by default. Change the default for newly generated applications to whitelist all attribute assignment. Also update the generated model classes so users are reminded of the importance of attr_accessible. *NZKoz*
230
231 * Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings. *Jacobkg*
232
233 * Fix associations when using per class databases. *larskanis*
234
235 * Revert setting NOT NULL constraints in add_timestamps *fxn*
236
237 * Fix mysql to use proper text types. Fixes #3931. *kennyj*
238
239 * Fix #5069 - Protect foreign key from mass assignment through association builder. *byroot*
240
db743ff @rafaelfranca Fix my name in the CHANGELOG to follow the convention
rafaelfranca authored
241
242 ## Rails 3.2.2 (March 1, 2012) ##
243
244 * No changes.
245
246
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
247 ## Rails 3.2.1 (January 26, 2012) ##
fab664a @jonleighton Fix another race condition.
jonleighton authored
248
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
249 * The threshold for auto EXPLAIN is ignored if there's no logger. *fxn*
250
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
251 * Call `to_s` on the value passed to `table_name=`, in particular symbols
252 are supported (regression). *Sergey Nartimov*
253
fab664a @jonleighton Fix another race condition.
jonleighton authored
254 * Fix possible race condition when two threads try to define attribute
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
255 methods for the same class. *Jon Leighton*
256
fab664a @jonleighton Fix another race condition.
jonleighton authored
257
f36dcaf @dhh Preparing for 3.2.0 release
dhh authored
258 ## Rails 3.2.0 (January 20, 2012) ##
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
259
4c5b73f @tenderlove Merge pull request #4531 from exviva/pessimistic_with_lock
tenderlove authored
260 * Added a `with_lock` method to ActiveRecord objects, which starts
261 a transaction, locks the object (pessimistically) and yields to the block.
262 The method takes one (optional) parameter and passes it to `lock!`.
263
264 Before:
265
266 class Order < ActiveRecord::Base
267 def cancel!
268 transaction do
269 lock!
270 # ... cancelling logic
271 end
272 end
273 end
274
275 After:
276
277 class Order < ActiveRecord::Base
278 def cancel!
279 with_lock do
280 # ... cancelling logic
281 end
282 end
283 end
284
285 *Olek Janiszewski*
286
3f16f5b @spastorino Add CHANGELOG entry
spastorino authored
287 * 'on' and 'ON' boolean columns values are type casted to true
288 *Santiago Pastorino*
289
35a1744 @drogus Allow to run migrations with given scope, with SCOPE=<scope>
drogus authored
290 * Added ability to run migrations only for given scope, which allows
291 to run migrations only from one engine (for example to revert changes
292 from engine that you want to remove).
293
294 Example:
295 rake db:migrate SCOPE=blog
296
4c5b73f @tenderlove Merge pull request #4531 from exviva/pessimistic_with_lock
tenderlove authored
297 *Piotr Sarnacki*
35a1744 @drogus Allow to run migrations with given scope, with SCOPE=<scope>
drogus authored
298
299 * Migrations copied from engines are now scoped with engine's name,
300 for example 01_create_posts.blog.rb. *Piotr Sarnacki*
301
de24ed9 @fxn removes the convenience instance version of AR::Base.silence_auto_exp…
fxn authored
302 * Implements `AR::Base.silence_auto_explain`. This method allows the user to
303 selectively disable automatic EXPLAINs within a block. *fxn*
0be5ada @fxn implements AR::Base(.|#)silence_auto_explain
fxn authored
304
0306f82 @fxn implements automatic EXPLAIN logging for slow queries
fxn authored
305 * Implements automatic EXPLAIN logging for slow queries.
306
307 A new configuration parameter `config.active_record.auto_explain_threshold_in_seconds`
308 determines what's to be considered a slow query. Setting that to `nil` disables
309 this feature. Defaults are 0.5 in development mode, and `nil` in test and production
310 modes.
311
312 As of this writing there's support for SQLite, MySQL (mysql2 adapter), and
313 PostgreSQL.
314
315 *fxn*
a382d60 @bogdan ActiveRecord::Relation#pluck method
bogdan authored
316
317 * Implemented ActiveRecord::Relation#pluck method
318
319 Method returns Array of column value from table under ActiveRecord model
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
320
a382d60 @bogdan ActiveRecord::Relation#pluck method
bogdan authored
321 Client.pluck(:id)
322
323 *Bogdan Gusiev*
324
0e2477b @tenderlove Automatic closure of connections in threads is deprecated. For example
tenderlove authored
325 * Automatic closure of connections in threads is deprecated. For example
326 the following code is deprecated:
327
328 Thread.new { Post.find(1) }.join
329
330 It should be changed to close the database connection at the end of
331 the thread:
332
333 Thread.new {
334 Post.find(1)
335 Post.connection.close
336 }.join
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
337
0e2477b @tenderlove Automatic closure of connections in threads is deprecated. For example
tenderlove authored
338 Only people who spawn threads in their application code need to worry
339 about this change.
340
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
341 * Deprecated:
342
343 * `set_table_name`
344 * `set_inheritance_column`
7af719e @jonleighton Deprecate set_sequence_name in favour of self.sequence_name=
jonleighton authored
345 * `set_sequence_name`
1a474cc @jonleighton Deprecate set_primary_key in favour of self.primary_key=
jonleighton authored
346 * `set_primary_key`
f3c84dc @jonleighton Deprecate set_locking_column in favour of self.locking_column=
jonleighton authored
347 * `set_locking_column`
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
348
349 Use an assignment method instead. For example, instead of `set_table_name`, use `self.table_name=`:
0b72a04 @jonleighton Deprecate set_table_name in favour of self.table_name= or defining yo…
jonleighton authored
350
351 class Project < ActiveRecord::Base
352 self.table_name = "project"
353 end
354
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
355 Or define your own `self.table_name` method:
356
0b72a04 @jonleighton Deprecate set_table_name in favour of self.table_name= or defining yo…
jonleighton authored
357 class Post < ActiveRecord::Base
358 def self.table_name
359 "special_" + super
360 end
361 end
362 Post.table_name # => "special_posts"
363
364 *Jon Leighton*
365
10834e9 @joshsusser changelog & docs for GeneratedFeatureMethods
joshsusser authored
366 * Generated association methods are created within a separate module to allow overriding and
367 composition using `super`. For a class named `MyModel`, the module is named
368 `MyModel::GeneratedFeatureMethods`. It is included into the model class immediately after
369 the `generated_attributes_methods` module defined in ActiveModel, so association methods
370 override attribute methods of the same name. *Josh Susser*
371
e7b7b44 @fxn implements AR::Relation#explain
fxn authored
372 * Implemented ActiveRecord::Relation#explain. *fxn*
373
562583c @jonleighton Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query
jonleighton authored
374 * Add ActiveRecord::Relation#uniq for generating unique queries.
375
376 Before:
377
378 Client.select('DISTINCT name')
379
380 After:
381
382 Client.select(:name).uniq
383
384 This also allows you to revert the unqueness in a relation:
385
386 Client.select(:name).uniq.uniq(false)
387
388 *Jon Leighton*
389
69dcd45 @vjebelev AR changes to support creating ordered (asc, desc) indexes
vjebelev authored
390 * Support index sort order in sqlite, mysql and postgres adapters. *Vlad Jebelev*
391
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
392 * Allow the :class_name option for associations to take a symbol (:Client) in addition to
393 a string ('Client').
394
395 This is to avoid confusing newbies, and to be consistent with the fact that other options
396 like :foreign_key already allow a symbol or a string.
397
398 *Jon Leighton*
399
400 * In development mode the db:drop task also drops the test database. For symmetry with
401 the db:create task. *Dmitriy Kiriyenko*
402
403 * Added ActiveRecord::Base.store for declaring simple single-column key/value stores *DHH*
404
405 class User < ActiveRecord::Base
406 store :settings, accessors: [ :color, :homepage ]
407 end
408
409 u = User.new(color: 'black', homepage: '37signals.com')
410 u.color # Accessor stored attribute
411 u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor
412
413
414 * MySQL: case-insensitive uniqueness validation avoids calling LOWER when
415 the column already uses a case-insensitive collation. Fixes #561.
416
417 *Joseph Palermo*
418
419 * Transactional fixtures enlist all active database connections. You can test
420 models on different connections without disabling transactional fixtures.
421
422 *Jeremy Kemper*
423
424 * Add first_or_create, first_or_create!, first_or_initialize methods to Active Record. This is a
425 better approach over the old find_or_create_by dynamic methods because it's clearer which
426 arguments are used to find the record and which are used to create it:
427
428 User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson")
429
430 *Andrés Mejía*
431
432 * Fix nested attributes bug where _destroy parameter is taken into account
433 during :reject_if => :all_blank (fixes #2937)
434
435 *Aaron Christy*
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
436
04d5eae @bdurand Add ActiveSupport::Cache::NullStore to expose caching interface witho…
bdurand authored
437 * Add ActiveSupport::Cache::NullStore for use in development and testing.
438
439 *Brian Durand*
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
440
8efced6 @fxn CHANGELOGs are now per branch
fxn authored
441 Please check [3-1-stable](https://github.com/rails/rails/blob/3-1-stable/activerecord/CHANGELOG.md) for previous changes.
Something went wrong with that request. Please try again.