Fix Rails 1.2.5 deprecation warnings.

This commit is contained in:
Jacques Distler 2007-10-15 19:12:36 +00:00
parent 2c8a3ec4d7
commit ab63a21ccd
2 changed files with 4 additions and 4 deletions

View file

@ -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
revisions.create(:content => content, :author => author, :revised_at => time)
revisions.build(:content => content, :author => author, :revised_at => time)
end
save
self

View file

@ -116,19 +116,19 @@ class PageRenderer
else
link_type = WikiReference.link_type(@revision.page.web, referenced_name)
end
references.create :referenced_name => referenced_name, :link_type => link_type
references.build :referenced_name => referenced_name, :link_type => link_type
end
include_chunks = rendering_result.find_chunks(Include)
includes = include_chunks.map { |c| ( c.escaped? ? nil : c.page_name ) }.compact.uniq
includes.each do |included_page_name|
references.create :referenced_name => included_page_name,
references.build :referenced_name => included_page_name,
:link_type => WikiReference::INCLUDED_PAGE
end
categories = rendering_result.find_chunks(Category).map { |cat| cat.list }.flatten
categories.each do |category|
references.create :referenced_name => category, :link_type => WikiReference::CATEGORY
references.build :referenced_name => category, :link_type => WikiReference::CATEGORY
end
end
end