Have you tried?:
class MyClass < ActiveRecord::Base
def destroy
update_attribute(:status, 0)
end
end
EDIT: Based on comments, there might be something else at work and it might just be the (:dependent=>'') designation on the association definition -- or if it's a HABTM, it might not work at all. Maybe this info on delete and destroy through associations will help? Pasted relevant section below:
Delete or destroy?
has_many and has_and_belongs_to_many associations have the methods
destroy, delete, destroy_all and delete_all.
For has_and_belongs_to_many, delete and destroy are the same: they
cause the records in the join table to be removed.
For has_many, destroy will always call the destroy method of the
record(s) being removed so that callbacks are run. However delete will
either do the deletion according to the strategy specified by the
:dependent option, or if no :dependent option is given, then it will
follow the default strategy. The default strategy is :nullify (set the
foreign keys to nil), except for has_many :through, where the default
strategy is delete_all (delete the join records, without running their
callbacks).