goddamnyouryan / coven-api

All the news a programmer needs in once place. http://www.coven.link
8 stars 4 forks source link

Using delete_all instead of destroy_all to avoid object initialization #1

Closed antstorm closed 9 years ago

antstorm commented 9 years ago

.destroy_all initializes every object before deleting it, since there are no relations or callbacks that is not needed.

Using .delete_all instead will simply execute DELETE FROM posts request, which is much faster.

goddamnyouryan commented 9 years ago

Awesome. Great call. Merged and deployed!