mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-24 17:56:10 +01:00
several fixes to recurring todos and adds some named_scopes
fixes case where unmarking a complete todo which belongs to a recurring pattern results in two todos that both keep on recurring. With this fix a new todo will only be created when there are no active todos left belonging to that recurring pattern fixes tests that failed because of previous commits adds some named_scopes, inspired by http://railscasts.com/episodes/108
This commit is contained in:
parent
bd2b410c7b
commit
4a98ee5669
8 changed files with 55 additions and 31 deletions
|
|
@ -4,7 +4,10 @@ class Todo < ActiveRecord::Base
|
|||
belongs_to :project
|
||||
belongs_to :user
|
||||
belongs_to :recurring_todo
|
||||
|
||||
|
||||
named_scope :active, :conditions => { :state => 'active' }
|
||||
named_scope :not_completed, :conditions => ['NOT state = ? ', 'completed']
|
||||
|
||||
STARRED_TAG_NAME = "starred"
|
||||
|
||||
acts_as_state_machine :initial => :active, :column => 'state'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue