Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/message.rb.svn-base @ 210:0579821a129a
Update to Redmine trunk rev 4802
author | Chris Cannam |
---|---|
date | Tue, 08 Feb 2011 13:51:46 +0000 |
parents | 513646585e45 |
children | cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
128:07fa8a8b56a8 | 210:0579821a129a |
---|---|
39 attr_protected :locked, :sticky | 39 attr_protected :locked, :sticky |
40 validates_presence_of :board, :subject, :content | 40 validates_presence_of :board, :subject, :content |
41 validates_length_of :subject, :maximum => 255 | 41 validates_length_of :subject, :maximum => 255 |
42 | 42 |
43 after_create :add_author_as_watcher | 43 after_create :add_author_as_watcher |
44 | |
45 named_scope :visible, lambda {|*args| { :include => {:board => :project}, | |
46 :conditions => Project.allowed_to_condition(args.first || User.current, :view_messages) } } | |
44 | 47 |
45 def visible?(user=User.current) | 48 def visible?(user=User.current) |
46 !user.nil? && user.allowed_to?(:view_messages, project) | 49 !user.nil? && user.allowed_to?(:view_messages, project) |
47 end | 50 end |
48 | 51 |