Files
grecia/lib/tasks/polls.rake
Javi Martín 1d0b05832c Add info messages for release 1.0.0 tasks
So users know what's going on when they upgrade CONSUL.
2019-06-05 20:23:56 +02:00

11 lines
292 B
Ruby

namespace :poll do
desc "Generate slugs polls"
task generate_slugs: :environment do
ApplicationLogger.new.info "Generating poll slugs"
Poll.find_each do |poll|
poll.update_columns(slug: poll.generate_slug, updated_at: Time.current) if poll.generate_slug?
end
end
end