rake task to destroy versions with event_attatchments

This commit is contained in:
Praveen Kumar 2016-08-16 18:38:36 +05:30 committed by redasus
parent 46774748ba
commit 45e53a2ae9

View file

@ -0,0 +1,8 @@
namespace :db do
desc 'Destroy event_attachments versions'
task destroy_event_attachment_versions: :environment do
PaperTrail::Version.where(item_type: 'EventAttachment').try(:destroy_all)
puts 'Version records with event_attachment have been destroyed'
end
end