diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-29 10:53:33 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-29 10:53:33 +0100 |
commit | 8f0f07863727edaad1e59df4ab4ec159016917e7 (patch) | |
tree | 22c1026bbc6a9f22f4f861ea63cd0a2946192da5 /activerecord/lib/active_record | |
parent | 4dbfe18b37ad4fa95eecb9082a446c798e84e499 (diff) | |
download | rails-8f0f07863727edaad1e59df4ab4ec159016917e7.tar.gz rails-8f0f07863727edaad1e59df4ab4ec159016917e7.tar.bz2 rails-8f0f07863727edaad1e59df4ab4ec159016917e7.zip |
Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [#689 status:committed]
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 9 |
1 files changed, 5 insertions, 4 deletions
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 |