forked from TracksApp/tracks
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
6 changed files
with
101 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
db/migrate/20090531111711_add_show_always_to_recurring_todo.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters