Hi All,
I have several controllers that need a soft delete because the records in
those tables are versioned. I've overwritten do_destroy in such a way that
allows me to this. If I define the method directly in the controller, it is
used when that action is called, but if I define it in the application
controller, it continues to use the default. I also tried putting it in a
module and including the module directly in the controller. Any idea where
I can put this to make it generally available?
thx
-C
p.s. shouldn't really matter, but here's the method I've written for
reference. the logger in here is just so that I could verify whether or not
it was being used.
def do_destroy
destroy_find_record
begin
3.times { logger.info "X" * 40 }
@record.destroyed_at = Time.now
@record.destroyed_by = @session_user
self.successful = @record.save!
rescue
flash[:warning] = as_(:cant_destroy_record, :record =>
@record.to_label)
self.successful = false
end
end
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.