diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-05 12:50:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-05 12:50:19 +0000 |
commit | 405fc07e90730c550f1e690a446eda872fd8732d (patch) | |
tree | 31e34beee0e4475e530fbeba6e6a5631f6fe3e4f /app/models/document.rb | |
parent | c2095f5e2f4e92dcfae3d7d5ccbe8900844c5361 (diff) | |
download | redmine-405fc07e90730c550f1e690a446eda872fd8732d.tar.gz redmine-405fc07e90730c550f1e690a446eda872fd8732d.zip |
Makes visible scopes accept projects option and deprecate Project.visible_by.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5324 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/document.rb')
-rw-r--r-- | app/models/document.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index 21232a2d9..d51f2d328 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -30,7 +30,7 @@ class Document < ActiveRecord::Base validates_length_of :title, :maximum => 60 named_scope :visible, lambda {|*args| { :include => :project, - :conditions => Project.allowed_to_condition(args.first || User.current, :view_documents) } } + :conditions => Project.allowed_to_condition(args.shift || User.current, :view_documents, *args) } } def visible?(user=User.current) !user.nil? && user.allowed_to?(:view_documents, project) |