public Method

Base.destroy

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.