mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 00:08:50 +01:00
16 lines
417 B
Ruby
16 lines
417 B
Ruby
|
|
class MakeOldRecurringTodosValidate < ActiveRecord::Migration
|
||
|
|
def self.up
|
||
|
|
RecurringTodo.find(:all).each do |rt|
|
||
|
|
# show_always may not be nil
|
||
|
|
rt.show_always = false if rt.show_always.nil?
|
||
|
|
# start date should be filled
|
||
|
|
rt.start_from = rt.created_at if rt.start_from.nil? || rt.start_from.blank?
|
||
|
|
rt.save!
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
def self.down
|
||
|
|
# no down: leave them validatable
|
||
|
|
end
|
||
|
|
end
|