Deleted the last of the rendering logic from Revision (making it a totally anemic entity, by the way)

This commit is contained in:
Alexey Verkhovsky 2005-09-09 20:40:35 +00:00
parent 427f989d69
commit 4838f6e684
3 changed files with 4 additions and 10 deletions

View file

@ -13,7 +13,8 @@ class Page < ActiveRecord::Base
author = Author.new(author.to_s) unless author.is_a?(Author)
# Try to render content to make sure that markup engine can take it,
Revision.new(:page => self, :content => content, :author => author, :revised_at => time).force_rendering
r = Revision.new(:page => self, :content => content, :author => author, :revised_at => time)
PageRenderer.new(r).force_rendering
# A user may change a page, look at it and make some more changes - several times.
# Not to record every such iteration as a new revision, if the previous revision was done

View file

@ -1,12 +1,4 @@
require 'diff'
class Revision < ActiveRecord::Base
belongs_to :page
composed_of :author, :mapping => [ %w(author name), %w(ip ip) ]
after_create :force_rendering
def force_rendering
PageRenderer.new(self).force_rendering
end
end

View file

@ -1,3 +1,4 @@
require 'diff'
# Temporary class containing all rendering stuff from a Revision
# I want to shift all rendering loguc to the controller eventually