aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 992303fc8f..0a844cc348 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -962,11 +962,10 @@ module ActiveRecord #:nodoc:
# be made (since they can't be persisted).
def destroy
unless new_record?
- connection.delete(
- "DELETE
- "WHERE #{self.class.primary_key} = #{quote(id)}",
- "#{self.class.name} Destroy"
- )
+ connection.delete <<-end_sql, "#{self.class.name} Destroy"
+ DELETE FROM #{self.class.table_name}
+ WHERE #{self.class.primary_key} = #{quoted_id}
+ end_sql
end
freeze