Use the 'pages' association in Web#add_page

This commit is contained in:
James Herdman 2009-08-31 01:16:21 -04:00
parent c5beb7d9a1
commit 33bbf31333

View file

@ -32,7 +32,7 @@ class Web < ActiveRecord::Base
end end
def add_page(name, content, time, author, renderer) def add_page(name, content, time, author, renderer)
page = page(name) || Page.new(:web => self, :name => name) page = page(name) || pages.build(:name => name)
page.revise(content, name, time, author, renderer) page.revise(content, name, time, author, renderer)
end end