Fixed some bugs in tasks, apple feature:
* Update ordergroup stats when task is destroyed. * Removed assigned caching attribute in task object. * A lot of eager loading for tasks controller.
This commit is contained in:
parent
9919183cb0
commit
0dff5ea784
10 changed files with 52 additions and 46 deletions
|
|
@ -2,16 +2,6 @@ class Assignment < ActiveRecord::Base
|
|||
|
||||
belongs_to :user
|
||||
belongs_to :task
|
||||
|
||||
# after user is assigned mark task as assigned
|
||||
def after_create
|
||||
self.task.update_attribute(:assigned, true)
|
||||
end
|
||||
|
||||
# update assigned-attribute
|
||||
def after_destroy
|
||||
self.task.update_attribute(:assigned, false) if self.task.assignments.empty?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue