mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-25 18:26:10 +01:00
html fixes and sort by number of todos logic
This commit is contained in:
parent
385f34d071
commit
0b57b23b2d
3 changed files with 15 additions and 7 deletions
|
|
@ -51,10 +51,9 @@ class User < ActiveRecord::Base
|
|||
self.update_positions(projects.map{ |p| p.id })
|
||||
return projects
|
||||
end
|
||||
def actionize(scope_conditions = {})
|
||||
def actionize(proj,scope_conditions = {})
|
||||
self.update_positions(proj.map{ |p| p.id })
|
||||
projects = find(:all, :conditions => scope_conditions)
|
||||
projects.sort!{ |x,y| y.todos.count(:state == 'active') <=> x.todos.count(:state == 'active') }
|
||||
self.update_positions(projects.map{ |p| p.id })
|
||||
return projects
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue