From 97019f9f5a94fa102debe13f5a957726e7d4783e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 31 Mar 2008 01:49:57 +0000 Subject: Partial updates play nice with updated_at/on timestamps git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/timestamp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb index dc95d2aabb..a9e0efa6fe 100644 --- a/activerecord/lib/active_record/timestamp.rb +++ b/activerecord/lib/active_record/timestamp.rb @@ -30,7 +30,7 @@ module ActiveRecord end def update_with_timestamps(*args) #:nodoc: - if record_timestamps + if record_timestamps && (!partial_updates? || changed?) t = self.class.default_timezone == :utc ? Time.now.utc : Time.now write_attribute('updated_at', t) if respond_to?(:updated_at) write_attribute('updated_on', t) if respond_to?(:updated_on) -- cgit v1.2.3