Have a Star option on task entry screens #928

This commit is contained in:
Demian Gemperli 2011-07-30 18:52:11 +02:00
parent f4a07110ff
commit c45b11dc70
8 changed files with 29 additions and 17 deletions

View file

@ -248,14 +248,16 @@ class Todo < ActiveRecord::Base
end
def toggle_star!
if starred?
_remove_tags STARRED_TAG_NAME
tags.reload
else
starred=!starred?
end
def starred=(starred)
if starred
_add_tags(STARRED_TAG_NAME)
tags.reload
end
starred?
else
_remove_tags STARRED_TAG_NAME
end
starred
end
def from_recurring_todo?