Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…#689 status:committed]
  • Loading branch information...
commit 8f0f07863727edaad1e59df4ab4ec159016917e7 1 parent 4dbfe18
@dhh dhh authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 activerecord/lib/active_record/base.rb
View
9 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
Please sign in to comment.
Something went wrong with that request. Please try again.