[FIXES BUILD] Fixed categories behavior and added id generation in import_storage. Something is still wrong with orphaned pages though
This commit is contained in:
parent
303622341b
commit
c4f593151e
12 changed files with 149 additions and 66 deletions
|
@ -1,7 +1,7 @@
|
|||
class Page < ActiveRecord::Base
|
||||
belongs_to :web
|
||||
has_many :revisions, :order => 'id'
|
||||
has_many :wiki_references, :order => 'referenced_page_name'
|
||||
has_many :wiki_references, :order => 'referenced_name'
|
||||
has_one :current_revision, :class_name => 'Revision', :order => 'id DESC'
|
||||
|
||||
def revise(content, time, author, renderer)
|
||||
|
@ -15,7 +15,7 @@ class Page < ActiveRecord::Base
|
|||
|
||||
# Try to render content to make sure that markup engine can take it,
|
||||
renderer.revision = Revision.new(
|
||||
:page => self, :content => content, :author => author, :revised_at => time)
|
||||
:page => self, :content => content, :author => author, :revised_at => time)
|
||||
renderer.display_content
|
||||
|
||||
# A user may change a page, look at it and make some more changes - several times.
|
||||
|
@ -25,7 +25,7 @@ class Page < ActiveRecord::Base
|
|||
if (revisions_size > 0) && continous_revision?(time, author)
|
||||
current_revision.update_attributes(:content => content, :revised_at => time)
|
||||
else
|
||||
Revision.create(:page => self, :content => content, :author => author, :revised_at => time)
|
||||
revisions.create(:content => content, :author => author, :revised_at => time)
|
||||
end
|
||||
save
|
||||
self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue