mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-03 06:21:49 +01:00
A few fixes after more thorough review.
This commit is contained in:
parent
778427405a
commit
f52a2eafa8
7 changed files with 13 additions and 13 deletions
|
|
@ -4,17 +4,16 @@ class ChangeDatesToDatetimes < ActiveRecord::Migration
|
|||
change_column :todos, :due, :datetime
|
||||
change_column :recurring_todos, :start_from, :datetime
|
||||
change_column :recurring_todos, :end_date, :datetime
|
||||
|
||||
|
||||
User.all(:include => [:todos, :recurring_todos]).each do |user|
|
||||
zone = TimeZone[user.prefs.time_zone]
|
||||
user.todos.each do |todo|
|
||||
todo.update_attribute(:show_from, user.at_midnight(todo.show_from)) unless d.nil?
|
||||
todo.update_attribute(:due, user.at_midnight(todo.due)) unless d.nil?
|
||||
todo.update_attribute(:show_from, user.at_midnight(todo.show_from)) unless todo.show_from.nil?
|
||||
todo.update_attribute(:due, user.at_midnight(todo.due)) unless todo.due.nil?
|
||||
end
|
||||
|
||||
|
||||
user.recurring_todos.each do |todo|
|
||||
todo.update_attribute(:start_from, user.at_midnight(todo.start_from)) unless d.nil?
|
||||
todo.update_attribute(:end_date, user.at_midnight(todo.end_date)) unless d.nil?
|
||||
todo.update_attribute(:start_from, user.at_midnight(todo.start_from)) unless todo.start_from.nil?
|
||||
todo.update_attribute(:end_date, user.at_midnight(todo.end_date)) unless todo.end_date.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue