Thanks Dan. Why Resource#destroy doesn't appear in the API documentation? http://rdoc.info/projects/datamapper/dm-core
Dan Kubb (dkubb) wrote: > Mark, > > > BTW I notice that the API documentation linked from datamapper.org > > lists the method as #destroy!, but the documentation on merbivore.com > > (which I believe datamapper.org used to point to) has #destroy. I'm > > guessing that #destroy! is correct, but is the documentation on > > merbivore no longer being mainntained? Or am I missing something? > > The merbivore docs are probably way out of date, #destroy and > #destroy! are valid methods on resources and collections, and soon > models too. > > The difference is that #destroy will initialize the resource, run it's > before filters and validations, and only if those pass will it remove > the resource. Resource#destroy! will bypass filters and validations > and remove the resource directly from the datastore. > Collection#destroy! also bypasses filters and validations, and does > not initialize the resource at all, it simply instructs the datastore > to do a bulk delete of all resources in the collection. > > The #destroy method is considered safe, and is what you should use > most of the time. > > -- > > Dan > (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
