diff --git a/app/controllers/cms_controller.rb b/app/controllers/cms_controller.rb index e545aed..94f436f 100644 --- a/app/controllers/cms_controller.rb +++ b/app/controllers/cms_controller.rb @@ -1,2 +1,3 @@ class CmsController < ComatoseAdminController + define_option :page_class, Article end diff --git a/app/controllers/content_viewer_controller.rb b/app/controllers/content_viewer_controller.rb index 859facc..9788aca 100644 --- a/app/controllers/content_viewer_controller.rb +++ b/app/controllers/content_viewer_controller.rb @@ -4,7 +4,7 @@ class ContentViewerController < ApplicationController path = params[:page].clone path.unshift(params[:profile]) @path = path.join('/') - @page = Comatose::Page.find_by_path(@path) + @page = Article.find_by_path(@path) if @page.nil? render :action => 'not_found', :status => 404 end diff --git a/app/models/article.rb b/app/models/article.rb new file mode 100644 index 0000000..a7eefb8 --- /dev/null +++ b/app/models/article.rb @@ -0,0 +1,4 @@ +class Article < Comatose::Page +end +class Article < Comatose::Page +end diff --git a/db/migrate/008_add_comatose_support.rb b/db/migrate/008_add_comatose_support.rb index 5866141..2dfc7af 100644 --- a/db/migrate/008_add_comatose_support.rb +++ b/db/migrate/008_add_comatose_support.rb @@ -22,6 +22,10 @@ class AddComatoseSupport < ActiveRecord::Migration t.column "version", :integer t.column "updated_on", :datetime t.column "created_on", :datetime + + # added for STI in noosfero + t.column 'type', :string + end Comatose::Page.create_versioned_table puts "Creating the default 'Home Page'..." diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 45515b7..e4d519c 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -17,7 +17,7 @@ class ContentViewerControllerTest < Test::Unit::TestCase def test_should_display_homepage uses_host 'anhetegua.net' - Comatose::Page.expects(:find_by_path).with('aprofile').returns(Comatose::Page.new) + Article.expects(:find_by_path).with('aprofile').returns(Article.new) get :view_page, :profile => 'aprofile', :page => [] assert_response :success -- libgit2 0.21.2