Permalink
Browse files

Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [

…#689 status:committed]
  • Loading branch information...
1 parent 4dbfe18 commit 8f0f07863727edaad1e59df4ab4ec159016917e7 @dhh dhh committed Oct 29, 2008
Showing with 5 additions and 4 deletions.
  1. +5 −4 activerecord/lib/active_record/base.rb
@@ -2410,10 +2410,11 @@ def delete
# 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

0 comments on commit 8f0f078

Please sign in to comment.