Skip to content

HTTPS clone URL

Subversion checkout URL

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