Deletes the record in the database and freezes this instance to reflect that no changes should be made (since they can’t be persisted).
Source Code
# File active_record/base.rb, line 1983 def destroy unless new_record? connection.delete "DELETE FROM \#{self.class.quoted_table_name}\nWHERE \#{connection.quote_column_name(self.class.primary_key)} = \#{quoted_id}\n", "#{self.class.name} Destroy" end freeze end
<code/>and<pre/>for code samples.