Use the 'pages' association in Web#add_page
This commit is contained in:
parent
c5beb7d9a1
commit
33bbf31333
|
@ -32,7 +32,7 @@ class Web < ActiveRecord::Base
|
|||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue