mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [#689 status:committed]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user