comparison app/models/.svn/text-base/document.rb.svn-base @ 246:eeebe205a056 cannam

* Merge from default branch, bringing us up to SVN trunk rev 4993
author Chris Cannam
date Thu, 03 Mar 2011 12:02:03 +0000
parents 0579821a129a
children cbce1fd3b1b7
comparison
equal deleted inserted replaced
138:fca2657f4aa5 246:eeebe205a056
27 acts_as_activity_provider :find_options => {:include => :project} 27 acts_as_activity_provider :find_options => {:include => :project}
28 28
29 validates_presence_of :project, :title, :category 29 validates_presence_of :project, :title, :category
30 validates_length_of :title, :maximum => 60 30 validates_length_of :title, :maximum => 60
31 31
32 named_scope :visible, lambda {|*args| { :include => :project,
33 :conditions => Project.allowed_to_condition(args.first || User.current, :view_documents) } }
34
32 def visible?(user=User.current) 35 def visible?(user=User.current)
33 !user.nil? && user.allowed_to?(:view_documents, project) 36 !user.nil? && user.allowed_to?(:view_documents, project)
34 end 37 end
35 38
36 def after_initialize 39 def after_initialize