Override ActiveRecord:Base.destroy

Dear rails developpers Im build a new adapter (mongo)

I need to override this:

  # Deletes the record in the database and freezes this instance

to reflect that no changes should
# be made (since they can’t be persisted).
def destroy
unless new_record?
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
  end

I tried (As I see on the web) to override it with
destroy_without_callbacks, but didn’t work. Any suggestion?

Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs