This project is archived and is in readonly mode.

#5440 ✓ resolved
Wincent Colaiuta

ActiveRecord::record_timestamps broken in RC2 (regression from RC1)

Reported by Wincent Colaiuta | August 24th, 2010 @ 01:32 PM | in 3.0.2

Just noticed that ActiveRecord::Base.record_timestamps = false no longer prevents timestamps from being updated. This is a regression in RC2; the issue was not present in RC1.

Demo using an "Article" mode in a rails console session:

>> a=Article.first
  Article Load (0.2ms)  SELECT `articles`.* FROM `articles` LIMIT 1
>> Article.record_timestamps
=> true
>> Article.record_timestamps = false
=> false
>> Article.record_timestamps
=> false
>> a.public = false
=> false
>> a.save
  SQL (0.2ms)  UPDATE `articles` SET `public` = 0, `updated_at` = '2010-08-24 12:25:58' WHERE (`articles`.`id` = 1)

Same bug occurs when setting the record_timestamps value on ActiveRecord::Base itself:

>> ActiveRecord::Base.record_timestamps 
=> true
>> ActiveRecord::Base.record_timestamps = false
=> false
>> a=Article.first
  Article Load (0.2ms)  SELECT `articles`.* FROM `articles` LIMIT 1
>> a.public=true
=> true
>> a.save
  SQL (0.2ms)  UPDATE `articles` SET `public` = 1, `updated_at` = '2010-08-24 12:27:11' WHERE (`articles`.`id` = 1)

Going to use git bisect to see if I can locate the bad commit. There are a couple of candidates I can see in the history that touch code in the record_timestamps path. Will post back once I've found the commit.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Attachments

Referenced by

Pages