I'm using AS with acts_as_paranoid. Act_as_paranoid is used to do a
logical delete (don't delete really), it uses delete_at attribute to
mark registers as "deleted". If deleted_at attribute is not null is
"deleted" else will be showed in any query. If I want to show "deleted"
registers I must use Model.find_with_deleted, with Model.find show
register with deleted_at with nil value.
I override search form and added a checkbox for show "deleted"
register. Then when checkbox is checked, I want to use for search
find_with_deleted method. I debugged until active_scaffold/lib/finder.rb
file and modified find_page method, but I don't know if it's correct.
Does anyone have a better idea?
Regards
--
Rafael Garcia Ortega
I don't remember how acts_as_paranoid works. You must override destroy method
in the model if plugin doesn't do it. Also you must set
conditions_for_collection to filter out deleted records in the controller, or
override beginning_of_chain to use a scope method, unless acts_as_paranoid set
a default_scope to filter out the records, in that case maybe you don't need
anymore.
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com