summaryrefslogtreecommitdiffstats
path: root/app/models/message.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 12:50:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 12:50:19 +0000
commit405fc07e90730c550f1e690a446eda872fd8732d (patch)
tree31e34beee0e4475e530fbeba6e6a5631f6fe3e4f /app/models/message.rb
parentc2095f5e2f4e92dcfae3d7d5ccbe8900844c5361 (diff)
downloadredmine-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/message.rb')
-rw-r--r--app/models/message.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/message.rb b/app/models/message.rb
index 77c9ff550..776af6e4a 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -24,7 +24,7 @@ class Message < ActiveRecord::Base
acts_as_searchable :columns => ['subject', 'content'],
:include => {:board => :project},
- :project_key => 'project_id',
+ :project_key => "#{Board.table_name}.project_id",
:date_column => "#{table_name}.created_on"
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
:description => :content,
@@ -43,7 +43,7 @@ class Message < ActiveRecord::Base
after_create :add_author_as_watcher
named_scope :visible, lambda {|*args| { :include => {:board => :project},
- :conditions => Project.allowed_to_condition(args.first || User.current, :view_messages) } }
+ :conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } }
def visible?(user=User.current)
!user.nil? && user.allowed_to?(:view_messages, project)