aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authortnp <tnp@cruzio.com>2010-09-24 10:35:35 -0700
committerJosé Valim <jose.valim@gmail.com>2010-09-24 20:42:38 +0200
commit55b6fa9370dbdac23b0df2bbcb70b2e2d604b410 (patch)
tree8183e0695cb21f3df8cc701bc0049463712e2ede /activerecord/lib/active_record
parent8d30193b08bd2321a7a78a1f481bd5e4d4d45557 (diff)
downloadrails-55b6fa9370dbdac23b0df2bbcb70b2e2d604b410.tar.gz
rails-55b6fa9370dbdac23b0df2bbcb70b2e2d604b410.tar.bz2
rails-55b6fa9370dbdac23b0df2bbcb70b2e2d604b410.zip
restore behavior of touch for models without :updated_xx [#5439 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/persistence.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index f80e304c5d..707c1a05be 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -222,9 +222,8 @@ module ActiveRecord
# @brake.touch
def touch(name = nil)
attributes = timestamp_attributes_for_update_in_model
- unless attributes.blank?
- attributes << name if name
-
+ attributes << name if name
+ unless attributes.empty?
current_time = current_time_from_proper_timezone
changes = {}