Now creating periodic task via button
This commit is contained in:
parent
4037ef12da
commit
6b62fc90d8
6 changed files with 10 additions and 12 deletions
|
|
@ -2,7 +2,7 @@ class Task < ActiveRecord::Base
|
|||
has_many :assignments, :dependent => :destroy
|
||||
has_many :users, :through => :assignments
|
||||
belongs_to :workgroup
|
||||
belongs_to :periodic_task_group, :inverse_of => :tasks
|
||||
belongs_to :periodic_task_group
|
||||
|
||||
scope :non_group, where(workgroup_id: nil, done: false)
|
||||
scope :done, where(done: true)
|
||||
|
|
@ -47,14 +47,10 @@ class Task < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def periodic
|
||||
def periodic?
|
||||
not periodic_task_group.nil?
|
||||
end
|
||||
|
||||
def periodic=(p)
|
||||
self.periodic_task_group = PeriodicTaskGroup.new if p == "1"
|
||||
end
|
||||
|
||||
def is_assigned?(user)
|
||||
self.assignments.detect {|ass| ass.user_id == user.id }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue