aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/timestamp.rb
diff options
context:
space:
mode:
authorPotapov Sergey <blake131313@gmail.com>2014-02-16 14:40:23 +0200
committerPotapov Sergey <blake131313@gmail.com>2014-02-16 14:40:23 +0200
commitb892d20c610af78a94ba6c9488092ef76845242a (patch)
treedc40fbea21795d98c996182842e18c44764bc82b /activerecord/lib/active_record/timestamp.rb
parent8b80e3c59c0b3cd788aa674508fff28d29fda6a0 (diff)
downloadrails-b892d20c610af78a94ba6c9488092ef76845242a.tar.gz
rails-b892d20c610af78a94ba6c9488092ef76845242a.tar.bz2
rails-b892d20c610af78a94ba6c9488092ef76845242a.zip
Do not try to write timestamps if they are missing #8813
Diffstat (limited to 'activerecord/lib/active_record/timestamp.rb')
-rw-r--r--activerecord/lib/active_record/timestamp.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index 7178bed560..271f58cbe0 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -48,7 +48,7 @@ module ActiveRecord
current_time = current_time_from_proper_timezone
all_timestamp_attributes.each do |column|
- if respond_to?(column) && respond_to?("#{column}=") && self.send(column).nil?
+ if attributes.has_key?(column.to_s) && self.send(column).nil?
write_attribute(column.to_s, current_time)
end
end