Merge pull request #1152 from ghost/master
rake task to destroy versions with event_attatchments
This commit is contained in:
commit
9a151b60fc
1 changed files with 8 additions and 0 deletions
8
lib/tasks/event_attatchments.rake
Normal file
8
lib/tasks/event_attatchments.rake
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue