From 8f0f07863727edaad1e59df4ab4ec159016917e7 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 29 Oct 2008 10:53:33 +0100 Subject: Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [#689 status:committed] --- activerecord/lib/active_record/base.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 9c5690d3fd..a36a137f0d 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2410,10 +2410,11 @@ module ActiveRecord #:nodoc: # be made (since they can't be persisted). def destroy unless new_record? - connection.delete <<-end_sql, "#{self.class.name} Destroy" - DELETE FROM #{self.class.quoted_table_name} - WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id} - end_sql + connection.delete( + "DELETE FROM #{self.class.quoted_table_name} " + + "WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id}", + "#{self.class.name} Destroy" + ) end freeze -- cgit v1.2.3