diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 15967a91..5c3f38e7 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -122,7 +122,7 @@ class WikiController < ApplicationController @version_pages = Paginator.new self, @version_count, per_page_option, params['p'] # don't load text @versions = @page.content.versions.find :all, - :select => "id, user_id, notes, updated_at, version", + :select => "id, user_id, notes, created_at, version", :order => 'version DESC', :limit => @version_pages.items_per_page + 1, :offset => @version_pages.current.offset diff --git a/app/models/message.rb b/app/models/message.rb index 5eae0654..8e68d208 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -29,7 +29,7 @@ class Message < ActiveRecord::Base if o.parent_id.nil? {:id => o.id} else - {:id => o.parent_id, :r => o.id, :anchor => "message-#{o.id}"} + {:id => o.parent_id, :r => o.versioned.id, :anchor => "message-#{o.versioned.id}"} end.reverse_merge :controller => 'messages', :action => 'show', :board_id => o.board_id end), :activity_find_options => { :include => { :board => :project } } diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb index a2e4dcaf..945fcaec 100644 --- a/app/models/wiki_content.rb +++ b/app/models/wiki_content.rb @@ -57,11 +57,16 @@ class WikiContent < ActiveRecord::Base WikiContentJournal.class_eval do attr_protected :data after_save :compress_version_text + after_save :move_comments_to_notes # Wiki Content might be large and the data should possibly be compressed def compress_version_text self.text = changes["text"].last if changes["text"] end + + def move_comments_to_notes + self.notes = changes.delete("comments").last if changes["comments"] + end def text=(plain) case Setting.wiki_compression @@ -99,4 +104,4 @@ class WikiContent < ActiveRecord::Base @previous ||= versioned.journals.at(version - 1) end end -end \ No newline at end of file +end diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index 72f5ff33..d7e12d6c 100644 --- a/app/views/wiki/history.rhtml +++ b/app/views/wiki/history.rhtml @@ -21,7 +21,7 @@