Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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