mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 18:56:10 +01:00
fix some regressions caused by the newer acts_as_list gem
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
92c8cfe61a
commit
4927f39594
9 changed files with 85 additions and 72 deletions
|
|
@ -7,7 +7,7 @@ class Context < ActiveRecord::Base
|
|||
named_scope :active, :conditions => { :hide => false }
|
||||
named_scope :hidden, :conditions => { :hide => true }
|
||||
|
||||
acts_as_list :scope => :user
|
||||
acts_as_list :scope => :user, :top_of_list => 0
|
||||
extend NamePartFinder
|
||||
include Tracks::TodoList
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ class Context < ActiveRecord::Base
|
|||
:description => "Lists all the contexts for #{user.display_name}"
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
def self.null_object
|
||||
NullContext.new
|
||||
end
|
||||
|
|
@ -33,29 +33,29 @@ class Context < ActiveRecord::Base
|
|||
def hidden?
|
||||
self.hide == true || self.hide == 1
|
||||
end
|
||||
|
||||
|
||||
def title
|
||||
name
|
||||
end
|
||||
|
||||
|
||||
def new_record_before_save?
|
||||
@new_record_before_save
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class NullContext
|
||||
|
||||
|
||||
def nil?
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
def id
|
||||
nil
|
||||
end
|
||||
|
||||
|
||||
def name
|
||||
''
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue