diff options
author | Luis Hurtado <luis@time4code.com> | 2008-12-22 15:18:43 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-22 15:19:33 +0000 |
commit | 63aac338332a06d3c9e28dde7954679703ec7620 (patch) | |
tree | 29444858c43d6f3a22e9f50ed5e2252ecb6e862a /activerecord/lib/active_record | |
parent | 70456aed31ae64b36563fc5d32ac114e0a095231 (diff) | |
download | rails-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/active_record')
-rw-r--r-- | activerecord/lib/active_record/timestamp.rb | 4 |
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 |