On Wed, May 18, 2011 at 9:09 AM, Michel Pigassou
<dagnan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi.
>
> I''m looking for different point of views, or maybe a "state
of the art"
> view, for a technically simple question.
>
> I have many models that a user has the power to destroy, and I also want to
> compute data from these models, even after they are destroyed.
>
> 2 choices are possible (maybe other can be found?):
> - not deleting data (and move them in an archive table, or keep them in
> their original place with a marker saying they are deleted)
> - pre-computing data from the deleted stuff (in order to be re-analyzed
> later). The point here is to fill another table, for example
''stats'', with
> few rows, and deleting (destroying) all the records that the user wants to
> destroy.
>
> What do you think is the best?
>
If it were me I would consider what the cost of doing your first option (the
delete flag) would be in terms of table size and its result on the app. If
it is not an issue, go this way, it will be easier I think. Also, if you run
your analysis reports on some regular basis, you could purge records flagged
as deleted after you run the report. Your second option of pre-computing I
like if you know exactly what you want... that also would not be so bad, you
just add a callback ''on delete'' which does this for you.
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.