aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorLuis Hurtado <luis@time4code.com>2008-12-22 15:18:43 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-12-22 15:19:33 +0000
commit63aac338332a06d3c9e28dde7954679703ec7620 (patch)
tree29444858c43d6f3a22e9f50ed5e2252ecb6e862a /activerecord/lib
parent70456aed31ae64b36563fc5d32ac114e0a095231 (diff)
downloadrails-63aac338332a06d3c9e28dde7954679703ec7620.tar.gz
rails-63aac338332a06d3c9e28dde7954679703ec7620.tar.bz2
rails-63aac338332a06d3c9e28dde7954679703ec7620.zip
Ensure of Model#create support custom updated_at and updated_on attributes [#1612 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/timestamp.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index a9e0efa6fe..8dbe80a01a 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -23,8 +23,8 @@ module ActiveRecord
write_attribute('created_at', t) if respond_to?(:created_at) && created_at.nil?
write_attribute('created_on', t) if respond_to?(:created_on) && created_on.nil?
- write_attribute('updated_at', t) if respond_to?(:updated_at)
- write_attribute('updated_on', t) if respond_to?(:updated_on)
+ write_attribute('updated_at', t) if respond_to?(:updated_at) && updated_at.nil?
+ write_attribute('updated_on', t) if respond_to?(:updated_on) && updated_on.nil?
end
create_without_timestamps
end