mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
fixed #781:
* added a "show always" radio to the recurring todo forms * added a show_always flag to recurring todos * created a migration to convert existing recurring todos where show_from_delta==0 * recurring todos where show_from_delta is 0 are now shown the same day they're due Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
8002eef8ab
commit
4e1e18da0f
6 changed files with 101 additions and 12 deletions
|
|
@ -0,0 +1,16 @@
|
|||
class AddShowAlwaysToRecurringTodo < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :recurring_todos, :show_always, :boolean
|
||||
recurring_todos = RecurringTodo.find(:all)
|
||||
recurring_todos.each do |recurring_todo|
|
||||
if recurring_todo.show_from_delta == 0 or recurring_todo.show_from_delta.nil?
|
||||
recurring_todo.show_always = true
|
||||
recurring_todo.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :recurring_todos, :show_always
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue