Skip to content

HTTPS clone URL

Subversion checkout URL

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