summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_content.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-27 17:54:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-27 17:54:09 +0000
commita774c5c48b5e596770340b6ac27ea9f0a1e1141f (patch)
tree7c0ab261c09324cbef711cba9ab3400d3c610cc2 /app/models/wiki_content.rb
parent1721376542af256263d605a16c3981eca9e3733a (diff)
downloadredmine-a774c5c48b5e596770340b6ac27ea9f0a1e1141f.tar.gz
redmine-a774c5c48b5e596770340b6ac27ea9f0a1e1141f.zip
Activity refactoring.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1701 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki_content.rb')
-rw-r--r--app/models/wiki_content.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb
index 724354ad6..f2ee39c4d 100644
--- a/app/models/wiki_content.rb
+++ b/app/models/wiki_content.rb
@@ -35,6 +35,17 @@ class WikiContent < ActiveRecord::Base
:type => 'wiki-page',
:url => Proc.new {|o| {:controller => 'wiki', :id => o.page.wiki.project_id, :page => o.page.title, :version => o.version}}
+ acts_as_activity_provider :type => 'wiki_pages',
+ :timestamp => "#{WikiContent.versioned_table_name}.updated_on",
+ :permission => :view_wiki_pages,
+ :find_options => {:select => "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
+ "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title, " +
+ "#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
+ "#{WikiContent.versioned_table_name}.id",
+ :joins => "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
+ "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " +
+ "LEFT JOIN #{Project.table_name} ON #{Project.table_name}.id = #{Wiki.table_name}.project_id"}
+
def text=(plain)
case Setting.wiki_compression
when 'gzip'