Skip to content

Commit

Permalink
Set published_at to event.scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
Senen committed Dec 27, 2017
1 parent 7c83ee4 commit 1ce2dbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tasks/events.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ namespace :events do
puts "Starting conversion of old events without status to accepted"
Event.where("status is ? AND scheduled > ?", nil, Time.zone.today).each do |event|
event.update_attribute(:status, :accepted)
event.update_attribute(:publised_at, event.scheduled.to_time)
end
puts "Finished conversion of old events without status to accepted"

puts "Starting conversion of old events without status to done"
Event.where("status is ? AND scheduled <= ?", nil, Time.zone.today).each do |event|
event.update_attribute(:status, :done)
event.update_attribute(:publised_at, event.scheduled.to_time)
end
puts "Finished conversion of old events without status to done"
end
Expand Down

0 comments on commit 1ce2dbd

Please sign in to comment.