event_news/lib/tasks/event_news_tasks.rake

9 lines
223 B
Ruby

desc 'Remove duplicated EventNews created by preview'
namespace :event_news do
task :remove_preview_event_news => [:environment] do
event_news = EventNews.where(is_preview: true)
event_news.destroy_all
end
end