mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-05 07:21:48 +01:00
Merge branch 'master' into rails4
Conflicts: Gemfile.lock config/routes.rb
This commit is contained in:
commit
4a485558e2
51 changed files with 5475 additions and 5015 deletions
|
|
@ -539,14 +539,13 @@ class RecurringTodo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def get_monthly_date(previous)
|
||||
|
||||
start = determine_start(previous)
|
||||
day = self.every_other1
|
||||
n = self.every_other2
|
||||
|
||||
case self.recurrence_selector
|
||||
when 0 # specific day of the month
|
||||
if start.mday >= day
|
||||
if start.mday > day
|
||||
# there is no next day n in this month, search in next month
|
||||
#
|
||||
# start += n.months
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class Todo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
event :block do
|
||||
transitions :to => :pending, :from => [:active, :deferred]
|
||||
transitions :to => :pending, :from => [:active, :deferred, :project_hidden]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -152,6 +152,14 @@ class Todo < ActiveRecord::Base
|
|||
return !( uncompleted_predecessors.empty? || state == 'project_hidden' )
|
||||
end
|
||||
|
||||
def guard_for_transition_from_deferred_to_pending
|
||||
no_uncompleted_predecessors? && not_part_of_hidden_container?
|
||||
end
|
||||
|
||||
def not_part_of_hidden_container?
|
||||
!( (self.project && self.project.hidden?) || self.context.hidden? )
|
||||
end
|
||||
|
||||
# Returns a string with description <context, project>
|
||||
def specification
|
||||
project_name = self.project.is_a?(NullProject) ? "(none)" : self.project.name
|
||||
|
|
@ -195,7 +203,7 @@ class Todo < ActiveRecord::Base
|
|||
def remove_predecessor(predecessor)
|
||||
self.predecessors.delete(predecessor)
|
||||
if self.predecessors.empty?
|
||||
self.activate!
|
||||
self.not_part_of_hidden_container? ? self.activate! : self.hide!
|
||||
else
|
||||
save!
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue