Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 986 lines (611 sloc) 28.196 kB
538f8ba @tenderlove updating changelogs
tenderlove authored
1 ## Rails 3.2.15 (Oct 16, 2013) ##
fdc3c08 @rafaelfranca Merge pull request #12359 from arthurnn/inverse_on_callbacks
rafaelfranca authored
2
fed6ac9 @arthurnn fix inverse_of when find_or_initialize_by_*
arthurnn authored
3 * When calling the method .find_or_initialize_by_* from a collection_proxy
4 it should set the inverse_of relation even when the entry was found on the db.
5
6 *arthurnn*
7
fdc3c08 @rafaelfranca Merge pull request #12359 from arthurnn/inverse_on_callbacks
rafaelfranca authored
8 * Callbacks on has_many should access the in memory parent if a inverse_of is set.
9
10 *arthurnn*
11
c9642e3 Fix FinderMethods#last unscoped primary key
Eugene Kalenkovich authored
12 * Fix `FinderMethods#last` unscoped primary key.
13
14 Fixes #11917.
15
16 *Eugene Kalenkovich*
33e1604 @alfredw Specified column type for quote_value
alfredw authored
17
0ec701d @kassio Load fixtures from linked folders
kassio authored
18 * Load fixtures from linked folders.
19
20 *Kassio Borges*
21
b4dea61 @Empact Tidy up the "Specified column type for quote_value" changes
Empact authored
22 * When using optimistic locking, `update` was not passing the column to `quote_value`
33e1604 @alfredw Specified column type for quote_value
alfredw authored
23 to allow the connection adapter to properly determine how to quote the value. This was
24 affecting certain databases that use specific colmn types.
b4dea61 @Empact Tidy up the "Specified column type for quote_value" changes
Empact authored
25
26 Fixes: #6763
33e1604 @alfredw Specified column type for quote_value
alfredw authored
27
28 *Alfred Wong*
29
30
47fb44f @rafaelfranca Update CHANGELOG entry
rafaelfranca authored
31 ## Rails 3.2.14 (Jul 22, 2013) ##
2ae2728 @senny Merge pull request #11451 from jetthoughts/11450_do_not_resave_destro…
senny authored
32
b289519 @90yukke Fix merge error when Equality LHS is non-attribute.
90yukke authored
33 * Fix merge error when Equality LHS is non-attribute.
34 Backport of #7380.
35
36 *Karmes Alexander*
37
2ae2728 @senny Merge pull request #11451 from jetthoughts/11450_do_not_resave_destro…
senny authored
38 * Do not re-create destroyed association when saving the parent object.
39
40 Fixes #11450.
41
42 *Paul Nikitochkin*
43
d704c1c @rafaelfranca Do not shallow the original exception in exec_cache
rafaelfranca authored
44 * Do not shallow the original exception in `exec_cache` on PostgreSQL adapter.
45
46 Fixes #11260.
47
48 *Rafael Mendonça França*
49
cde6ead @carlosantoniodasilva Move changelog entry to the top [ci skip]
carlosantoniodasilva authored
50 * Fix `ActiveRecord::Store` incorrectly tracking changes of its attributes.
51 Fixes #10373.
52
53 *Janko Marohnić*
54
839efc5 @chapmajs Allow global override of default STI inheritance column
chapmajs authored
55 * Fix a bug that prevented the use of the default STI inheritance column
56 (ActiveRecord::Base.inheritance_column = 'some_column'.)
57
58 *chapmajs + Takehiro Adachi*
59
a51d4e6 @senny Merge pull request #10925 from senny/10917_test_to_prevent_regression
senny authored
60 * Fix mysql2 adapter raises the correct exception when executing a query on a
61 closed connection.
62
63 *Yves Senn*
9756aa6 @carlosantoniodasilva Improve AR changelog [ci skip]
carlosantoniodasilva authored
64
27b3883 @senny Revert "Revert "Merge pull request #10901 from armstrjare/fix_query_n…
senny authored
65 * Fixes bug where `Company.new.contract_ids` would incorrectly load
66 all non-associated contracts.
67
68 Example:
69
70 company = Company.new # Company has many :contracts
71
72 # before
73 company.contract_ids # => SELECT ... WHERE `contracts`.`company_id` IS NULL
74
75 # after
76 company.contract_ids # => []
77
78 *Jared Armstrong*
79
d293990 @rafaelfranca Merge pull request #10713 from senny/10693_fix_primary_key_option_on_…
rafaelfranca authored
80 * Fix the `:primary_key` option for `has_many` associations.
81 Fixes #10693.
82
83 *Yves Senn*
84
c236246 @jholton destroys association records before saving/inserting new association …
jholton authored
85 * fixes bug introduced by #3329. Now, when autosaving associations,
86 deletions happen before inserts and saves. This prevents a 'duplicate
87 unique value' database error that would occur if a record being created had
88 the same value on a unique indexed field as that of a record being destroyed.
89
90 Backport of #10417
91
92 *Johnny Holton*
93
23c656c @Empact Backport a super-simplified version of #6792, fixing
Empact authored
94 * Fix that under some conditions, Active Record could produce invalid SQL of the sort:
95 "SELECT DISTINCT DISTINCT".
96
97 Backport of #6792.
98
99 *Ben Woosley*
100
b1fb8ef @rafaelfranca Improve CHANGELOG entries
rafaelfranca authored
101 * Require `ActiveRecord::Base` in railtie hooks for rake_tasks, console and runner to
102 avoid circular constant loading issues.
103
104 Backport #7695.
105
106 Fixes #7683 and #882
107
108 *Ben Holley*
38af354 @kennyj backport runner fixes to 3-2-stable
kennyj authored
109
c09829e @ahorner Preserve context for joins while merging relations
ahorner authored
110 * Maintain context for joins within ActiveRecord::Relation merges.
111 Backport #10164.
112
113 *Neeraj Singh + Andrew Horner*
442b7c8 @rafaelfranca Merge pull request #7695 from benolee/backport_cc7dd66_and_c0ba0f0
rafaelfranca authored
114
ddaa5d5 @dasch Don't try to EXPLAIN select_db calls
dasch authored
115 * Make sure the `EXPLAIN` command is never triggered by a `select_db` call.
116
117 *Daniel Schierbeck*
118
84c69a1 @rafaelfranca Revert "Merge pull request #8209 from senny/backport_8176"
rafaelfranca authored
119 * Revert changes on `pluck` that was ignoring the select clause when the relation already
120 has one. This caused a regression since it changed the behavior in a stable release.
121
122 Fixes #9777.
123
124 *Rafael Mendonça França*
125
f8c4a31 @rafaelfranca Merge pull request #10489 from greenriver/ar_counter_cache_multiple_d…
rafaelfranca authored
126 * Confirm a record has not already been destroyed before decrementing counter cache.
127
128 *Ben Tucker*
129
a6d9e16 @subwindow Correctly parse bigint defaults in PostgreSQL, Backpost #10098.
subwindow authored
130 * Default values for PostgreSQL bigint types now get parsed and dumped to the
131 schema correctly.
132 Backport #10098.
133
134 *Erik Peterson*
135
e06b4fa @rafaelfranca Removing explain support warning from the Railtie
rafaelfranca authored
136 * Removed warning when `auto_explain_threshold_in_seconds` is set and the
137 connection adapter doesn't support explain.
138 This is causing a regression since the Active Record Railtie is trying to
139 connect to the development database in the application boot.
140
141 *Rafael Mendonça França*
142
8bd56f0 @fredwu Added changelog for 55e2954
fredwu authored
143 * Do not reset `inheritance_column` when it's set explicitly.
144 Backport of #5327.
145
146 *kennyj + Fred Wu*
147
dc2bc38 @kennyj Wrong exception is occured when raising no translatable exception
kennyj authored
148 * Fix a problem wrong exception is occured
149 when raising no translatable exception in PostgreSQL.
150
151 *kennyj*
152
ca6a12d @dembskoi Reset postgreSQL search path in db:test:clone_structure.
dembskoi authored
153 * Resets the postgres search path in the structure.sql after the structure
154 is dumped in order to find schema_migrations table when multiples schemas
155 are used.
156 Fixes #9796.
157
158 *Juan M. Cuello + Dembskiy Alexander*
159
939b896 @larrylv Fix issue #7526. Reload the target if it's stale.
larrylv authored
160 * Reload the association target if it's stale. `@stale_state` should be nil
161 when a model isn't saved.
162 Fixes #7526.
163
164 *Larry Lv*
165
9756aa6 @carlosantoniodasilva Improve AR changelog [ci skip]
carlosantoniodasilva authored
166 * Don't read CSV files during execution of `db:fixtures:load`. CSV support for
167 fixtures was removed some time ago but the task was still loading them, even
168 though later the code was looking for the related yaml file instead.
3170d2b @authorNari Backported #6755 to 3-2-stable. Don't read csv file during executing …
authorNari authored
169
170 *kennyj*
c90e24d @carlosantoniodasilva Improve changelog entry [ci skip]
carlosantoniodasilva authored
171
51ae6f4 @steveklabnik Update CHANGELOGs for 3.2.13.rc1
steveklabnik authored
172
0e56c1d @claudiob Add release dates to documentation [ci skip]
claudiob authored
173 ## Rails 3.2.13 (Mar 18, 2013) ##
51ae6f4 @steveklabnik Update CHANGELOGs for 3.2.13.rc1
steveklabnik authored
174
453c7d6 @seejee Chained scopes will be preloaded properly. Fixes #7490
seejee authored
175 * Chaining multiple preloaded scopes will correctly preload all the scopes
176 at the same time.
177
178 *Chris Geihsler*
179
1a88523 @steveklabnik CHANGELOG entry for ee291b9.
steveklabnik authored
180 * Reverted 921a296a3390192a71abeec6d9a035cc6d1865c8, 'Quote numeric values
181 compared to string columns.' This caused several regressions.
182
183 *Steve Klabnik*
184
9756aa6 @carlosantoniodasilva Improve AR changelog [ci skip]
carlosantoniodasilva authored
185 * Fix overriding of attributes by `default_scope` on `ActiveRecord::Base#dup`.
55a1765 @yaotti Do not override attributes on `dup` by default scopes
yaotti authored
186
187 *Hiroshige UMINO*
188
c90e24d @carlosantoniodasilva Improve changelog entry [ci skip]
carlosantoniodasilva authored
189 * Fix issue with overriding Active Record reader methods with a composed object
190 and using that attribute as the scope of a `uniqueness_of` validation.
191 Backport #7072.
905b7df @authorNari Backported #7072 to 3-2-stable. Use database value for uniqueness val…
authorNari authored
192
193 *Peter Brown*
b972035 @rafaelfranca Fix the CHANGELOG headers [ci skip]
rafaelfranca authored
194
8f6fa34 @senny Sqlite preserves primary keys when copying/altering tables.
senny authored
195 * Sqlite now preserves custom primary keys when copying or altering tables.
196 Fixes #9367.
197 Backport #2312.
198
199 *Sean Scally + Yves Senn*
200
587f563 @senny don't cache invalid subsets when preloading hmt associations.
senny authored
201 * Preloading `has_many :through` associations with conditions won't
202 cache the `:through` association. This will prevent invalid
203 subsets to be cached.
204 Fixes #8423.
205 Backport #9252.
206
207 Example:
208
209 class User
210 has_many :posts
211 has_many :recent_comments, -> { where('created_at > ?', 1.week.ago) }, :through => :posts
212 end
213
214 a_user = User.includes(:recent_comments).first
215
216 # this is preloaded
217 a_user.recent_comments
218
219 # fetching the recent_comments through the posts association won't preload it.
220 a_user.posts
221
222 *Yves Senn*
223
3c5f631 @lilibethdlc Fix handling of dirty time zone aware attributes
lilibethdlc authored
224 * Fix handling of dirty time zone aware attributes
225
226 Previously, when `time_zone_aware_attributes` were enabled, after
227 changing a datetime or timestamp attribute and then changing it back
228 to the original value, `changed_attributes` still tracked the
229 attribute as changed. This caused `[attribute]_changed?` and
230 `changed?` methods to return true incorrectly.
231
232 Example:
233
234 in_time_zone 'Paris' do
235 order = Order.new
236 original_time = Time.local(2012, 10, 10)
237 order.shipped_at = original_time
238 order.save
239 order.changed? # => false
240
241 # changing value
242 order.shipped_at = Time.local(2013, 1, 1)
243 order.changed? # => true
244
245 # reverting to original value
246 order.shipped_at = original_time
247 order.changed? # => false, used to return true
248 end
249
250 Backport of #9073
251 Fixes #8898
252
253 *Lilibeth De La Cruz*
254
18ffe50 @matthewrobertson backport of fix for issue #7630
matthewrobertson authored
255 * Fix counter cache columns not updated when replacing `has_many :through`
256 associations.
257 Backport #8400.
258 Fix #7630.
259
260 *Matthew Robertson*
261
6a0a5f3 @drogus Duplicate column_defaults properly
drogus authored
262 * Don't update `column_defaults` when calling destructive methods on column with default value.
263 Backport c517602.
264 Fix #6115.
265
266 *Piotr Sarnacki + Aleksey Magusev + Alan Daud*
267
bf794bb @rafaelfranca Merge pull request #9078 from senny/6865_ar_count_with_uniq
rafaelfranca authored
268 * When `#count` is used in conjunction with `#uniq` we perform `count(:distinct => true)`.
269 Fix #6865.
270
271 Example:
272
273 relation.uniq.count # => SELECT COUNT(DISTINCT *)
274
275 *Yves Senn + Kaspar Schiess*
276
b6d4931 @elliterate Fix pluck when columns/tables are reserved words.
elliterate authored
277 * Fix `ActiveRecord::Relation#pluck` when columns or tables are reserved words.
278 Backport #7536.
279 Fix #8968.
280
281 *Ian Lesperance + Yves Senn + Kaspar Schiess*
282
2a5d119 @carlosantoniodasilva Add changelog entry for skipping explain from dbs that don't support it
carlosantoniodasilva authored
283 * Don't run explain on slow queries for database adapters that don't support it.
284 Backport #6197.
285
286 *Blake Smith*
287
97a4db9 @pixeltrix Revert "Merge pull request #6986 from kennyj/fix_6975"
pixeltrix authored
288 * Revert round usec when comparing timestamp attributes in the dirty tracking.
289 Fixes #8460.
290
291 *Andrew White*
292
18b9187 @ernie Revert "Merge pull request #7661 from ernie/build-join-records-on-uns…
ernie authored
293 * Revert creation of through association models when using `collection=[]`
294 on a `has_many :through` association from an unsaved model.
295 Fix #7661, #8269.
296
297 *Ernie Miller*
298
c147dd7 @trisweb Fix error when assigning NaN to an integer column
trisweb authored
299 * Fix undefined method `to_i` when calling `new` on a scope that uses an
300 Array; Fix FloatDomainError when setting integer column to NaN.
301 Fixes #8718, #8734, #8757.
e842dbb Fix undefined method `to_i' introduced since 3.2.8
Jason Stirk authored
302
c147dd7 @trisweb Fix error when assigning NaN to an integer column
trisweb authored
303 *Jason Stirk + Tristan Harward*
e842dbb Fix undefined method `to_i' introduced since 3.2.8
Jason Stirk authored
304
885f59f @rafaelfranca Serialized attribute can be serialized in an integer column
rafaelfranca authored
305 * Serialized attributes can be serialized in integer columns.
306 Fix #8575.
307
308 *Rafael Mendonça França*
309
9f69d42 @senny Backport #8522, Keep index names when using with sqlite3
senny authored
310 * Keep index names when using `alter_table` with sqlite3.
885f59f @rafaelfranca Serialized attribute can be serialized in an integer column
rafaelfranca authored
311 Fix #3489.
312 Backport #8522.
9f69d42 @senny Backport #8522, Keep index names when using with sqlite3
senny authored
313
314 *Yves Senn*
315
d68e299 @senny recognize migrations, in folders containing numbers and 'rb'.
senny authored
316 * Recognize migrations placed in directories containing numbers and 'rb'.
885f59f @rafaelfranca Serialized attribute can be serialized in an integer column
rafaelfranca authored
317 Fix #8492.
318 Backport of #8500.
d68e299 @senny recognize migrations, in folders containing numbers and 'rb'.
senny authored
319
320 *Yves Senn*
321
b097652 @rafaelfranca Allow users to choose the timestamp format in the cache key
rafaelfranca authored
322 * Add `ActiveRecord::Base.cache_timestamp_format` class attribute to control
323 the format of the timestamp value in the cache key.
324 This allows users to improve the precision of the cache key.
325 Fixes #8195.
326
327 *Rafael Mendonça França*
328
0ef70b8 @rafaelfranca Add CHANGELOG entry for #6376.
rafaelfranca authored
329 * Add `:nsec` date format. This can be used to improve the precision of cache key.
64281fb @carlosantoniodasilva Add :nsec format only for Ruby 1.9
carlosantoniodasilva authored
330 Please note that this format only works with Ruby 1.9, Ruby 1.8 will ignore it completely.
0ef70b8 @rafaelfranca Add CHANGELOG entry for #6376.
rafaelfranca authored
331
332 *Jamie Gaskins*
333
a3c3cfd @carlosantoniodasilva Unscope update_column(s) query to ignore default scope
carlosantoniodasilva authored
334 * Unscope `update_column(s)` query to ignore default scope.
335
336 When applying `default_scope` to a class with a where clause, using
337 `update_column(s)` could generate a query that would not properly update
338 the record due to the where clause from the `default_scope` being applied
339 to the update query.
340
341 class User < ActiveRecord::Base
342 default_scope where(active: true)
343 end
344
345 user = User.first
346 user.active = false
347 user.save!
348
349 user.update_column(:active, true) # => false
350
351 In this situation we want to skip the default_scope clause and just
352 update the record based on the primary key. With this change:
353
354 user.update_column(:active, true) # => true
355
356 Backport of #8436 fix.
357
358 *Carlos Antonio da Silva*
359
d70539c @rafaelfranca Merge pull request #8417 from kennyj/fix_8414
rafaelfranca authored
360 * Fix performance problem with primary_key method in PostgreSQL adapter when having many schemas.
361 Uses pg_constraint table instead of pg_depend table which has many records in general.
362 Fix #8414
363
364 *kennyj*
365
1b96176 @senny backport #8403, no intermediate AR objects when eager loading.
senny authored
366 * Do not instantiate intermediate Active Record objects when eager loading.
367 These records caused `after_find` to run more than expected.
368 Fix #3313
369 Backport of #8403
370
371 *Yves Senn*
372
a878126 @josevalim Merge pull request #4942 from bogdan/pluck_joins
josevalim authored
373 * Fix `pluck` to work with joins. Backport of #4942.
374
375 *Carlos Antonio da Silva*
376
564e32b @tenderlove Merge pull request #6397 from kennyj/fix_translate_exception
tenderlove authored
377 * Fix a problem with `translate_exception` method in a non English environment.
378 Backport of #6397.
379
380 *kennyj*
381
6fe1a4a @carlosantoniodasilva Merge pull request #8311 from alisdair/dirty-nullable-datetime
carlosantoniodasilva authored
382 * Fix dirty attribute checks for TimeZoneConversion with nil and blank
383 datetime attributes. Setting a nil datetime to a blank string should not
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
384 result in a change being flagged.
385 Fixes #8310.
386 Backport of #8311.
6fe1a4a @carlosantoniodasilva Merge pull request #8311 from alisdair/dirty-nullable-datetime
carlosantoniodasilva authored
387
388 *Alisdair McDiarmid*
389
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
390 * Prevent mass assignment to the type column of polymorphic associations when using `build`.
391 Fixes #8265.
392 Backport of #8291.
d397a38 @senny backport #8291, prevent mass assignment of polymorphic type with `build`
senny authored
393
394 *Yves Senn*
395
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
396 * When running migrations on Postgresql, the `:limit` option for `binary` and `text` columns is
397 silently dropped.
398 Previously, these migrations caused sql exceptions, because Postgresql doesn't support limits
399 on these types.
50f0046 @rafaelfranca Merge pull request #8276 from pwnall/pgsql_text_limits
rafaelfranca authored
400
401 *Victor Costan*
402
167b645 @carlosantoniodasilva Bring back test and changelog entry from #pluck method and select clause
carlosantoniodasilva authored
403 * `#pluck` can be used on a relation with `select` clause.
404 Fixes #7551.
405 Backport of #8176.
406
407 Example:
408
409 Topic.select([:approved, :id]).order(:id).pluck(:id)
410
411 *Yves Senn*
412
b56376b @nikitug Use nil? instead of blank? to check dynamic finder result
nikitug authored
413 * Use `nil?` instead of `blank?` to check whether dynamic finder with a bang
e4e2bcc @rafaelfranca Merge pull request #8204 from nikitug/fix_dynamic_finder_result_check
rafaelfranca authored
414 should raise RecordNotFound.
415 Fixes #7238.
b56376b @nikitug Use nil? instead of blank? to check dynamic finder result
nikitug authored
416
417 *Nikita Afanasenko*
418
e4e2bcc @rafaelfranca Merge pull request #8204 from nikitug/fix_dynamic_finder_result_check
rafaelfranca authored
419 * Fix deleting from a HABTM join table upon destroying an object of a model
420 with optimistic locking enabled.
421 Fixes #5332.
05e1466 @courtland Fix deleting from a HABTM join table upon destroying an object of a m…
courtland authored
422
423 *Nick Rogers*
424
fda9075 @kennyj Backport #8074 to 3-2-stable. Use query cache/uncache, when using not…
kennyj authored
425 * Use query cache/uncache when using ENV["DATABASE_URL"].
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
426 Fixes #6951.
427 Backport of #8074.
fda9075 @kennyj Backport #8074 to 3-2-stable. Use query cache/uncache, when using not…
kennyj authored
428
429 *kennyj*
430
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
431 * Do not create useless database transaction when building `has_one` association.
505bf59 @carlosantoniodasilva Merge pull request #8154 from bogdan/has_one_association_performance
carlosantoniodasilva authored
432
433 Example:
434
435 User.has_one :profile
436 User.new.build_profile
437
25a15a7 @rafaelfranca Make the CHANGELOG consistent [ci skip]
rafaelfranca authored
438 Backport of #8154.
439
505bf59 @carlosantoniodasilva Merge pull request #8154 from bogdan/has_one_association_performance
carlosantoniodasilva authored
440 *Bogdan Gusiev*
441
8dbf5a4 @nikitug Backport #8078: Fix `attributes_before_type_cast` for serialised attr…
nikitug authored
442 * `AR::Base#attributes_before_type_cast` now returns unserialized values for serialized attributes.
443
444 *Nikita Afanasenko*
445
58e48d5 Fix accepts_nested_attributes for child classes
Gabriel Sobrinho & Ricardo Henrique authored
446 * Fix issue that raises `NameError` when overriding the `accepts_nested_attributes` in child classes.
447
448 Before:
449
450 class Shared::Person < ActiveRecord::Base
451 has_one :address
452
453 accepts_nested_attributes :address, :reject_if => :all_blank
454 end
455
456 class Person < Shared::Person
457 accepts_nested_attributes :address
458 end
459
460 Person
461 #=> NameError: method `address_attributes=' not defined in Person
462
463 After:
464
465 Person
466 #=> Person(id: integer, ...)
467
468 Fixes #8131.
469
470 *Gabriel Sobrinho, Ricardo Henrique*
471
e0da95b @carlosantoniodasilva Update changelogs with version/release dates [ci skip]
carlosantoniodasilva authored
472
f15581b @jmccartie Fixed changelog typos [ci skip]
jmccartie authored
473 ## Rails 3.2.12 (Feb 11, 2013) ##
921a296 @guilleiguaran Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric
guilleiguaran authored
474
475 * Quote numeric values being compared to non-numeric columns. Otherwise,
476 in some database, the string column values will be coerced to a numeric
477 allowing 0, 0.0 or false to match any string starting with a non-digit.
478
479 Example:
480
481 App.where(apikey: 0) # => SELECT * FROM users WHERE apikey = '0'
482
483 *Dylan Smith*
484
e0da95b @carlosantoniodasilva Update changelogs with version/release dates [ci skip]
carlosantoniodasilva authored
485
11f5deb @carlosantoniodasilva Update changelogs with release date [ci skip]
carlosantoniodasilva authored
486 ## Rails 3.2.11 (Jan 8, 2013) ##
d5cd97b @tenderlove * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] …
tenderlove authored
487
488 * Fix querying with an empty hash *Damien Mathieu* [CVE-2013-0155]
cae0879 @rafaelfranca Fix the release in the CHANGELOG [ci skip]
rafaelfranca authored
489
11f5deb @carlosantoniodasilva Update changelogs with release date [ci skip]
carlosantoniodasilva authored
490
f4dc7e3 @rafaelfranca Add release date of 3.2.10
rafaelfranca authored
491 ## Rails 3.2.10 (Jan 2, 2013) ##
784a386 @tenderlove updating the changelog for the CVE
tenderlove authored
492
7d592ba @tenderlove updating changelog
tenderlove authored
493 * CVE-2012-5664 options hashes should only be extracted if there are extra
494 parameters
784a386 @tenderlove updating the changelog for the CVE
tenderlove authored
495
f4dc7e3 @rafaelfranca Add release date of 3.2.10
rafaelfranca authored
496
acc2aa4 @claudiob Add release date of Rails 3.2.9 to documentation
claudiob authored
497 ## Rails 3.2.9 (Nov 12, 2012) ##
6abe0e7 @rafaelfranca Backport explain fixes.
rafaelfranca authored
498
f4dc7e3 @rafaelfranca Add release date of 3.2.10
rafaelfranca authored
499 * Fix `find_in_batches` crashing when IDs are strings and start option is not specified.
500
501 *Alexis Bernard*
502
d37d40b @carlosantoniodasilva Fix issue with collection associations and first(n)/last(n)
carlosantoniodasilva authored
503 * Fix issue with collection associations calling first(n)/last(n) and attempting
504 to set the inverse association when `:inverse_of` was used. Fixes #8087.
505
506 *Carlos Antonio da Silva*
507
96a13fc @rafaelfranca Fix bug when Column is trying to type cast boolean values to integer.
rafaelfranca authored
508 * Fix bug when Column is trying to type cast boolean values to integer.
509 Fixes #8067.
510
511 *Rafael Mendonça França*
512
37c60c9 @rafaelfranca Add CHANGELOG entry to #8032 fix
rafaelfranca authored
513 * Fix bug where `rake db:test:prepare` tries to load the structure.sql into development database.
514 Fixes #8032.
515
516 *Grace Liu + Rafael Mendonça França*
517
d37d40b @carlosantoniodasilva Fix issue with collection associations and first(n)/last(n)
carlosantoniodasilva authored
518 * 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
519
cdfa4a5 @carlosantoniodasilva Merge pull request #8053 from henrik/update_columns_with_primary_key
carlosantoniodasilva authored
520 * Fix bug where `update_columns` and `update_column` would not let you update the primary key column.
521
522 *Henrik Nyh*
523
a119dd3 @rafaelfranca Merge pull request #7593 from veader/patch-1
rafaelfranca authored
524 * Decode URI encoded attributes on database connection URLs.
525
526 *Shawn Veader*
527
9a38e73 @spastorino Merge pull request #7371 from csmuc/fix_dup_validation_errors
spastorino authored
528 * Fix AR#dup to nullify the validation errors in the dup'ed object. Previously the original
529 and the dup'ed object shared the same errors.
530
d37d40b @carlosantoniodasilva Fix issue with collection associations and first(n)/last(n)
carlosantoniodasilva authored
531 *Christian Seiler*
9a38e73 @spastorino Merge pull request #7371 from csmuc/fix_dup_validation_errors
spastorino authored
532
d92e66f @tenderlove Synchronize around deleting from the reserved connections hash.
tenderlove authored
533 * Synchronize around deleting from the reserved connections hash.
534 Fixes #7955
535
3980465 @arturopie #7914 get default value when type uses schema name
arturopie authored
536 * PostgreSQL adapter correctly fetches default values when using
537 multiple schemas and domains in a db. Fixes #7914
538
539 *Arturo Pie*
540
990a938 @ernie Fix has_many assocation w/select load after create
ernie authored
541 * Fix deprecation notice when loading a collection association that
542 selects columns from other tables, if a new record was previously
543 built using that association.
544
545 *Ernie Miller*
546
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
547 * The postgres adapter now supports tables with capital letters.
548 Fix #5920
549
550 *Yves Senn*
551
552 * `CollectionAssociation#count` returns `0` without querying if the
553 parent record is not persisted.
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
554
555 Before:
556
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
557 person.pets.count
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
558 # SELECT COUNT(*) FROM "pets" WHERE "pets"."person_id" IS NULL
559 # => 0
560
561 After:
562
de360ac @rafaelfranca Merge pull request #7850 from senny/5920_postgres_adapter_table_with_…
rafaelfranca authored
563 person.pets.count
9896729 @rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
rafaelfranca authored
564 # fires without sql query
565 # => 0
566
567 *Francesco Rodriguez*
568
3f0bc97 @rafaelfranca Merge pull request #7822 from lulalala/reset-counter-cache-for-has-ma…
rafaelfranca authored
569 * Fix `reset_counters` crashing on `has_many :through` associations.
570 Fix #7822.
571
572 *lulalala*
573
3908706 @jrochkind ConnectionPool accepts spec key 'checkout_timeout'
jrochkind authored
574 * ConnectionPool recognizes checkout_timeout spec key as taking
575 precedence over legacy wait_timeout spec key, can be used to avoid
576 conflict with mysql2 use of wait_timeout. Closes #7684.
577
578 *jrochkind*
579
b8fba55 @tenderlove Merge pull request #3544 from amatsuda/_field_changed
tenderlove authored
580 * Rename field_changed? to _field_changed? so that users can create a field named field
581
582 *Akira Matsuda*, backported by *Steve Klabnik*
583
ee43989 @rafaelfranca Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt
rafaelfranca authored
584 * Fix creation of through association models when using `collection=[]`
585 on a `has_many :through` association from an unsaved model.
586 Fix #7661.
587
588 *Ernie Miller*
589
6abe0e7 @rafaelfranca Backport explain fixes.
rafaelfranca authored
590 * Explain only normal CRUD sql (select / update / insert / delete).
591 Fix problem that explains unexplainable sql. Closes #7544 #6458.
592
593 *kennyj*
594
f48bb01 Backport PostgreSQL auto-reconnect test coverage
Steve Jorgensen authored
595 * Backport test coverage to ensure that PostgreSQL auto-reconnect functionality
596 remains healthy.
597
2326d46 fix markdown markup in AR/CHANGELOG
Francesco Rodríguez authored
598 *Steve Jorgensen*
f48bb01 Backport PostgreSQL auto-reconnect test coverage
Steve Jorgensen authored
599
9630485 @kennyj Backported #7572 to 3-2-stable. Use config['encoding'], because datab…
kennyj authored
600 * Use config['encoding'] instead of config['charset'] when executing
601 databases.rake in the mysql/mysql2. A correct option for a database.yml
602 is 'encoding'.
603
604 *kennyj*
605
652107e @tchandy ConnectionAdapters::Column.type_cast_code should always convert value…
tchandy authored
606 * Fix ConnectionAdapters::Column.type_cast_code integer conversion,
607 to always convert values to integer calling #to_i. Fixes #7509.
608
609 *Thiago Pradi*
0fb6bbd @rafaelfranca Merge pull request #7140 from seamusabshere/patch-1
rafaelfranca authored
610
5054e26 @rafaelfranca Merge pull request #7337 from adzap/string_to_dummy_time
rafaelfranca authored
611 * Fix time column type casting for invalid time string values to correctly return nil.
612
613 *Adam Meehan*
614
01d09a6 @senny set the configured #inheritance_column on #become (#7503)
senny authored
615 * Fix `becomes` when using a configured `inheritance_column`.
616
617 *Yves Senn*
618
648c5a1 @rafaelfranca Merge pull request #5210 from Pliny/masteri
rafaelfranca authored
619 * Fix `reset_counters` when there are multiple `belongs_to` association with the
620 same foreign key and one of them have a counter cache.
621 Fixes #5200.
622
623 *Dave Desrochers*
624
8905c1f @rafaelfranca Merge pull request #6986 from kennyj/fix_6975
rafaelfranca authored
625 * Round usec when comparing timestamp attributes in the dirty tracking.
626 Fixes #6975.
627
628 *kennyj*
629
fdf4eae @carlosantoniodasilva Merge pull request #7377 from brainopia/use_inversed_parent_for_first…
carlosantoniodasilva authored
630 * Use inversed parent for first and last child of has_many association.
631
632 *Ravil Bayramgalin*
633
d6dbd7f @rafaelfranca Merge pull request #7352 from aripollak/microsecond-timestamp
rafaelfranca authored
634 * Fix Column.microseconds and Column.fast_string_to_date to avoid converting
635 timestamp seconds to a float, since it occasionally results in inaccuracies
636 with microsecond-precision times. Fixes #7352.
637
638 *Ari Pollak*
639
8055cd6 @rafaelfranca Do not use update_column where update_attribute is not interchangeable
rafaelfranca authored
640 * Fix `increment!`, `decrement!`, `toggle!` that was skipping callbacks.
641 Fixes #7306.
642
643 *Rafael Mendonça França*
644
786713a @rafaelfranca Merge pull request #6073 from daveyeu/restore-state-on-record-invalid
rafaelfranca authored
645 * Fix AR#create to return an unsaved record when AR::RecordInvalid is
646 raised. Fixes #3217.
647
648 *Dave Yeu*
649
3307a2e @rafaelfranca Add CHANGELOG entry for #7286
rafaelfranca authored
650 * Remove unnecessary transaction when assigning has_one associations with a nil or equal value.
651 Fix #7191.
652
653 *kennyj*
654
5c2fc69 @rafaelfranca Add CHANGELOG entry
rafaelfranca authored
655 * Allow store to work with an empty column.
656 Fix #4840.
657
658 *Jeremy Walker*
659
ea48732 @rafaelfranca Add CHANGELOG entry for a935c7a
rafaelfranca authored
660 * Remove prepared statement from system query in postgresql adapter.
661 Fix #5872.
662
663 *Ivan Evtuhovich*
664
0fb6bbd @rafaelfranca Merge pull request #7140 from seamusabshere/patch-1
rafaelfranca authored
665 * Make sure `:environment` task is executed before `db:schema:load` or `db:structure:load`
666 Fixes #4772.
667
668 *Seamus Abshere*
669
670
ddedf5d @spastorino Add release date to CHANGELOGs
spastorino authored
671 ## Rails 3.2.8 (Aug 9, 2012) ##
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
672
55e05d4 @rafaelfranca Do not consider the numeric attribute as changed if the old value is
rafaelfranca authored
673 * Do not consider the numeric attribute as changed if the old value is zero and the new value
674 is not a string.
675 Fixes #7237.
676
677 *Rafael Mendonça França*
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
678
81542f9 @fxn removes the deprecation of update_attribute
fxn authored
679 * Removes the deprecation of `update_attribute`. *fxn*
680
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
681 * Reverted the deprecation of `composed_of`. *Rafael Mendonça França*
682
0c52702 @jonleighton Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql."
jonleighton authored
683 * Reverted the deprecation of `*_sql` association options. They will
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
684 be deprecated in 4.0 instead. *Jon Leighton*
685
686 * Do not eager load AR session store. ActiveRecord::SessionStore depends on the abstract store
687 in Action Pack. Eager loading this class would break client code that eager loads Active Record
688 standalone.
689 Fixes #7160
0c52702 @jonleighton Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql."
jonleighton authored
690
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
691 *Xavier Noria*
6764b7b @spastorino Add missing CHANGELOG entries
spastorino authored
692
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
693 * Do not set RAILS_ENV to "development" when using `db:test:prepare` and related rake tasks.
694 This was causing the truncation of the development database data when using RSpec.
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
695 Fixes #7175.
a893672 @rafaelfranca Add CHANGELOG entry [ci skip]
rafaelfranca authored
696
697 *Rafael Mendonça França*
698
d1b9cf2 @tenderlove updating release date
tenderlove authored
699 ## Rails 3.2.7 (Jul 26, 2012) ##
2109fd5 @fxn registers the deprecation of update_attribute in the CHANGELOG
fxn authored
700
a79bfa9 @jonleighton Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql.
jonleighton authored
701 * `:finder_sql` and `:counter_sql` options on collection associations
702 are deprecated. Please transition to using scopes.
703
704 *Jon Leighton*
705
706 * `:insert_sql` and `:delete_sql` options on `has_and_belongs_to_many`
707 associations are deprecated. Please transition to using `has_many
708 :through`
709
710 *Jon Leighton*
711
857697b @rafaelfranca Fix CHANGELOGS
rafaelfranca authored
712 * `composed_of` has been deprecated. You'll have to write your own accessor
713 and mutator methods if you'd like to use value objects to represent some
714 portion of your models.
715
716 *Steve Klabnik*
717
2f930df @rafaelfranca Revert "Add update_columns and the suggestion of using update_columns
rafaelfranca authored
718 * `update_attribute` has been deprecated. Use `update_column` if
2109fd5 @fxn registers the deprecation of update_attribute in the CHANGELOG
fxn authored
719 you want to bypass mass-assignment protection, validations, callbacks,
720 and touching of updated_at. Otherwise please use `update_attributes`.
721
722 *Steve Klabnik*
723
8381d39 @tenderlove updating changelogs
tenderlove authored
724 ## Rails 3.2.6 (Jun 12, 2012) ##
959fb8e @jonleighton Revert "Perf: Don't load the association for #delete_all."
jonleighton authored
725
ceb8ec3 @tenderlove updating changelogs with security fixes
tenderlove authored
726 * protect against the nesting of hashes changing the
727 table context in the next call to build_from_hash. This fix
728 covers this case as well.
729
8381d39 @tenderlove updating changelogs
tenderlove authored
730 CVE-2012-2695
731
959fb8e @jonleighton Revert "Perf: Don't load the association for #delete_all."
jonleighton authored
732 * Revert earlier 'perf fix' (see 3.2.4 changelog / GH #6289). This
733 change introduced a regression (GH #6609). assoc.clear and
734 assoc.delete_all have loaded the association before doing the delete
735 since at least Rails 2.3. Doing the delete without loading the
736 records means that the `before_remove` and `after_remove` callbacks do
737 not get invoked. Therefore, this change was less a fix a more an
738 optimisation, which should only have gone into master.
739
740 *Jon Leighton*
741
b13d89e @rafaelfranca Add release date of 3.2.5 on the CHANGELOG
rafaelfranca authored
742 ## Rails 3.2.5 (Jun 1, 2012) ##
743
744 * Restore behavior of Active Record 3.2.3 scopes.
745 A series of commits relating to preloading and scopes caused a regression.
746
747 *Andrew White*
748
749
d3e5d1c @tenderlove updating changelogs
tenderlove authored
750 ## Rails 3.2.4 (May 31, 2012) ##
2c21a2f @benedikt Revert "Revert "Fix #5667. Preloading should ignore scoping.""
benedikt authored
751
b98d1e2 @jonleighton Perf: Don't load the association for #delete_all.
jonleighton authored
752 * Perf fix: Don't load the records when doing assoc.delete_all.
753 GH #6289. *Jon Leighton*
754
2c21a2f @benedikt Revert "Revert "Fix #5667. Preloading should ignore scoping.""
benedikt authored
755 * Association preloading shouldn't be affected by the current scoping.
756 This could cause infinite recursion and potentially other problems.
757 See GH #5667. *Jon Leighton*
758
d3e5d1c @tenderlove updating changelogs
tenderlove authored
759 * Datetime attributes are forced to be changed. GH #3965
760
761 * Fix attribute casting. GH #5549
762
763 * Fix #5667. Preloading should ignore scoping.
764
44aca7b @tenderlove adding security notifications to CHANGELOGs
tenderlove authored
765 * Predicate builder should not recurse for determining where columns.
766 Thanks to Ben Murphy for reporting this! CVE-2012-2661
767
b13d89e @rafaelfranca Add release date of 3.2.5 on the CHANGELOG
rafaelfranca authored
768
3005f58 @rafaelfranca Add release data to Rails 3.2.3
rafaelfranca authored
769 ## Rails 3.2.3 (March 30, 2012) ##
3bfd651 @vijaydev changelog updates [ci skip]
vijaydev authored
770
90d9635 @pixeltrix Add dynamic find_or_create_by_{attribute}! method.
pixeltrix authored
771 * Added find_or_create_by_{attribute}! dynamic method. *Andrew White*
772
3bfd651 @vijaydev changelog updates [ci skip]
vijaydev authored
773 * 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*
774
775 * Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings. *Jacobkg*
776
777 * Fix associations when using per class databases. *larskanis*
778
779 * Revert setting NOT NULL constraints in add_timestamps *fxn*
780
781 * Fix mysql to use proper text types. Fixes #3931. *kennyj*
782
783 * Fix #5069 - Protect foreign key from mass assignment through association builder. *byroot*
784
db743ff @rafaelfranca Fix my name in the CHANGELOG to follow the convention
rafaelfranca authored
785
786 ## Rails 3.2.2 (March 1, 2012) ##
787
788 * No changes.
789
790
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
791 ## Rails 3.2.1 (January 26, 2012) ##
fab664a @jonleighton Fix another race condition.
jonleighton authored
792
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
793 * The threshold for auto EXPLAIN is ignored if there's no logger. *fxn*
794
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
795 * Call `to_s` on the value passed to `table_name=`, in particular symbols
796 are supported (regression). *Sergey Nartimov*
797
fab664a @jonleighton Fix another race condition.
jonleighton authored
798 * Fix possible race condition when two threads try to define attribute
97e8d1d @fxn CHANGELOG revision for v3.2.1
fxn authored
799 methods for the same class. *Jon Leighton*
800
fab664a @jonleighton Fix another race condition.
jonleighton authored
801
f36dcaf @dhh Preparing for 3.2.0 release
dhh authored
802 ## Rails 3.2.0 (January 20, 2012) ##
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
803
4c5b73f @tenderlove Merge pull request #4531 from exviva/pessimistic_with_lock
tenderlove authored
804 * Added a `with_lock` method to ActiveRecord objects, which starts
805 a transaction, locks the object (pessimistically) and yields to the block.
806 The method takes one (optional) parameter and passes it to `lock!`.
807
808 Before:
809
810 class Order < ActiveRecord::Base
811 def cancel!
812 transaction do
813 lock!
814 # ... cancelling logic
815 end
816 end
817 end
818
819 After:
820
821 class Order < ActiveRecord::Base
822 def cancel!
823 with_lock do
824 # ... cancelling logic
825 end
826 end
827 end
828
829 *Olek Janiszewski*
830
3f16f5b @spastorino Add CHANGELOG entry
spastorino authored
831 * 'on' and 'ON' boolean columns values are type casted to true
832 *Santiago Pastorino*
833
35a1744 @drogus Allow to run migrations with given scope, with SCOPE=<scope>
drogus authored
834 * Added ability to run migrations only for given scope, which allows
835 to run migrations only from one engine (for example to revert changes
836 from engine that you want to remove).
837
838 Example:
839 rake db:migrate SCOPE=blog
840
4c5b73f @tenderlove Merge pull request #4531 from exviva/pessimistic_with_lock
tenderlove authored
841 *Piotr Sarnacki*
35a1744 @drogus Allow to run migrations with given scope, with SCOPE=<scope>
drogus authored
842
843 * Migrations copied from engines are now scoped with engine's name,
844 for example 01_create_posts.blog.rb. *Piotr Sarnacki*
845
de24ed9 @fxn removes the convenience instance version of AR::Base.silence_auto_exp…
fxn authored
846 * Implements `AR::Base.silence_auto_explain`. This method allows the user to
847 selectively disable automatic EXPLAINs within a block. *fxn*
0be5ada @fxn implements AR::Base(.|#)silence_auto_explain
fxn authored
848
0306f82 @fxn implements automatic EXPLAIN logging for slow queries
fxn authored
849 * Implements automatic EXPLAIN logging for slow queries.
850
851 A new configuration parameter `config.active_record.auto_explain_threshold_in_seconds`
852 determines what's to be considered a slow query. Setting that to `nil` disables
853 this feature. Defaults are 0.5 in development mode, and `nil` in test and production
854 modes.
855
856 As of this writing there's support for SQLite, MySQL (mysql2 adapter), and
857 PostgreSQL.
858
859 *fxn*
a382d60 @bogdan ActiveRecord::Relation#pluck method
bogdan authored
860
861 * Implemented ActiveRecord::Relation#pluck method
862
863 Method returns Array of column value from table under ActiveRecord model
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
864
a382d60 @bogdan ActiveRecord::Relation#pluck method
bogdan authored
865 Client.pluck(:id)
866
867 *Bogdan Gusiev*
868
0e2477b @tenderlove Automatic closure of connections in threads is deprecated. For example
tenderlove authored
869 * Automatic closure of connections in threads is deprecated. For example
870 the following code is deprecated:
871
872 Thread.new { Post.find(1) }.join
873
874 It should be changed to close the database connection at the end of
875 the thread:
876
877 Thread.new {
878 Post.find(1)
879 Post.connection.close
880 }.join
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
881
0e2477b @tenderlove Automatic closure of connections in threads is deprecated. For example
tenderlove authored
882 Only people who spawn threads in their application code need to worry
883 about this change.
884
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
885 * Deprecated:
886
887 * `set_table_name`
888 * `set_inheritance_column`
7af719e @jonleighton Deprecate set_sequence_name in favour of self.sequence_name=
jonleighton authored
889 * `set_sequence_name`
1a474cc @jonleighton Deprecate set_primary_key in favour of self.primary_key=
jonleighton authored
890 * `set_primary_key`
f3c84dc @jonleighton Deprecate set_locking_column in favour of self.locking_column=
jonleighton authored
891 * `set_locking_column`
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
892
893 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
894
895 class Project < ActiveRecord::Base
896 self.table_name = "project"
897 end
898
34609d6 @jonleighton Deprecate set_inheritance_column in favour of self.inheritance_column=
jonleighton authored
899 Or define your own `self.table_name` method:
900
0b72a04 @jonleighton Deprecate set_table_name in favour of self.table_name= or defining yo…
jonleighton authored
901 class Post < ActiveRecord::Base
902 def self.table_name
903 "special_" + super
904 end
905 end
906 Post.table_name # => "special_posts"
907
908 *Jon Leighton*
909
10834e9 @joshsusser changelog & docs for GeneratedFeatureMethods
joshsusser authored
910 * Generated association methods are created within a separate module to allow overriding and
911 composition using `super`. For a class named `MyModel`, the module is named
912 `MyModel::GeneratedFeatureMethods`. It is included into the model class immediately after
913 the `generated_attributes_methods` module defined in ActiveModel, so association methods
914 override attribute methods of the same name. *Josh Susser*
915
e7b7b44 @fxn implements AR::Relation#explain
fxn authored
916 * Implemented ActiveRecord::Relation#explain. *fxn*
917
562583c @jonleighton Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query
jonleighton authored
918 * Add ActiveRecord::Relation#uniq for generating unique queries.
919
920 Before:
921
922 Client.select('DISTINCT name')
923
924 After:
925
926 Client.select(:name).uniq
927
928 This also allows you to revert the unqueness in a relation:
929
930 Client.select(:name).uniq.uniq(false)
931
932 *Jon Leighton*
933
69dcd45 @vjebelev AR changes to support creating ordered (asc, desc) indexes
vjebelev authored
934 * Support index sort order in sqlite, mysql and postgres adapters. *Vlad Jebelev*
935
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
936 * Allow the :class_name option for associations to take a symbol (:Client) in addition to
937 a string ('Client').
938
939 This is to avoid confusing newbies, and to be consistent with the fact that other options
940 like :foreign_key already allow a symbol or a string.
941
942 *Jon Leighton*
943
944 * In development mode the db:drop task also drops the test database. For symmetry with
945 the db:create task. *Dmitriy Kiriyenko*
946
947 * Added ActiveRecord::Base.store for declaring simple single-column key/value stores *DHH*
948
949 class User < ActiveRecord::Base
950 store :settings, accessors: [ :color, :homepage ]
951 end
952
953 u = User.new(color: 'black', homepage: '37signals.com')
954 u.color # Accessor stored attribute
955 u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor
956
957
958 * MySQL: case-insensitive uniqueness validation avoids calling LOWER when
959 the column already uses a case-insensitive collation. Fixes #561.
960
961 *Joseph Palermo*
962
963 * Transactional fixtures enlist all active database connections. You can test
964 models on different connections without disabling transactional fixtures.
965
966 *Jeremy Kemper*
967
968 * Add first_or_create, first_or_create!, first_or_initialize methods to Active Record. This is a
969 better approach over the old find_or_create_by dynamic methods because it's clearer which
970 arguments are used to find the record and which are used to create it:
971
972 User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson")
973
974 *Andrés Mejía*
975
976 * Fix nested attributes bug where _destroy parameter is taken into account
977 during :reject_if => :all_blank (fixes #2937)
978
979 *Aaron Christy*
2809375 @fxn registers 2483460 in the CHANGELOG
fxn authored
980
04d5eae @bdurand Add ActiveSupport::Cache::NullStore to expose caching interface witho…
bdurand authored
981 * Add ActiveSupport::Cache::NullStore for use in development and testing.
982
983 *Brian Durand*
281272a @jonleighton Convert CHANGELOGs to Markdown format.
jonleighton authored
984
8efced6 @fxn CHANGELOGs are now per branch
fxn authored
985 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.