Fix Rails 1.2.5 deprecation warnings.
This commit is contained in:
parent
2c8a3ec4d7
commit
ab63a21ccd
|
@ -25,7 +25,7 @@ class Page < ActiveRecord::Base
|
||||||
if (revisions_size > 0) && continous_revision?(time, author)
|
if (revisions_size > 0) && continous_revision?(time, author)
|
||||||
current_revision.update_attributes(:content => content, :revised_at => time)
|
current_revision.update_attributes(:content => content, :revised_at => time)
|
||||||
else
|
else
|
||||||
revisions.create(:content => content, :author => author, :revised_at => time)
|
revisions.build(:content => content, :author => author, :revised_at => time)
|
||||||
end
|
end
|
||||||
save
|
save
|
||||||
self
|
self
|
||||||
|
|
|
@ -116,19 +116,19 @@ class PageRenderer
|
||||||
else
|
else
|
||||||
link_type = WikiReference.link_type(@revision.page.web, referenced_name)
|
link_type = WikiReference.link_type(@revision.page.web, referenced_name)
|
||||||
end
|
end
|
||||||
references.create :referenced_name => referenced_name, :link_type => link_type
|
references.build :referenced_name => referenced_name, :link_type => link_type
|
||||||
end
|
end
|
||||||
|
|
||||||
include_chunks = rendering_result.find_chunks(Include)
|
include_chunks = rendering_result.find_chunks(Include)
|
||||||
includes = include_chunks.map { |c| ( c.escaped? ? nil : c.page_name ) }.compact.uniq
|
includes = include_chunks.map { |c| ( c.escaped? ? nil : c.page_name ) }.compact.uniq
|
||||||
includes.each do |included_page_name|
|
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
|
:link_type => WikiReference::INCLUDED_PAGE
|
||||||
end
|
end
|
||||||
|
|
||||||
categories = rendering_result.find_chunks(Category).map { |cat| cat.list }.flatten
|
categories = rendering_result.find_chunks(Category).map { |cat| cat.list }.flatten
|
||||||
categories.each do |category|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue