Forum: Radiant CMS Migrating to mental

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ollivier R. (Guest)
on 2007-01-27 01:37
(Received via mailing list)
I've been following mental for some time and now attempted to migrate
my own site under it.

Did a pg_dump of my database, ran db:migrate to get the latest schema,
launch mongrel_rails on it, went to the admin interface and... <boom>

Any idea?  Something I missed?
-----
 ActiveRecord::SubclassNotFound in Admin/page#index

Showing app/views/admin/page/_node.rhtml where line #44 raised:

The single-table inheritance mechanism failed to locate the subclass:
'FilenotfoundpagePage'. This error is raised because the column
'class_name' is reserved for storing the class in case of inheritance.
Please rename this column if you didn't intend it to be used for
storing the inheritance class or overwrite Page.inheritance_column to
use another column for that information.

Extracted source (around line #44):

41: <% level = level + 1 -%>
42: <%
43: if expanded
44:   page.children.each do |child|
45: -%>
46: <%= render_node child, :level => level, :simple => simple -%>
47: <%

Trace of template inclusion: /app/views/admin/page/index.rhtml

RAILS_ROOT: /Volumes/Users/www/radiant-mental/config/..
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1066:in
`instantiate_without_callbacks'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:204:in
`instantiate'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`collect!'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:994:in
`find_every'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:415:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:91:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:159:in
`find_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:123:in
`load_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:122:in
`method_missing'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:98:in
`method_missing'
#{RAILS_ROOT}/app/views/admin/page/_node.rhtml:44:in
`_run_rhtml_47app47views47admin47page47_node46rhtml'
#{RAILS_ROOT}/app/helpers/admin/page_helper.rb:4:in `render_node'
#{RAILS_ROOT}/app/views/admin/page/index.rhtml:14:in
`_run_rhtml_47app47views47admin47page47index46rhtml'
/opt/local/bin/mongrel_rails:16:in `load'
/opt/local/bin/mongrel_rails:16

#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1066:in
`instantiate_without_callbacks'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:204:in
`instantiate'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`collect!'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:994:in
`find_every'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:415:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:91:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:159:in
`find_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:123:in
`load_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:122:in
`method_missing'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:98:in
`method_missing'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`compile_and_render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:275:in
`render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb:59:in
`render_partial'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:30:in
`benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb:58:in
`render_partial'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:287:in
`render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`compile_and_render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:806:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:711:in
`render_with_no_layout'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/layout.rb:247:in
`render_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render'
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1096:in
`perform_action_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:632:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
`perform_action'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
`process_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:624:in
`process_without_session_management_support'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
`process'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in
`process'
#{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:in `dispatch'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in
`process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
`synchronize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
`process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
`process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
`each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243

#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1066:in
`instantiate_without_callbacks'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:204:in
`instantiate'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`collect!'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:424:in
`find_by_sql'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:994:in
`find_every'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:415:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:91:in
`find'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:159:in
`find_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:123:in
`load_target'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:122:in
`method_missing'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:98:in
`method_missing'
#{RAILS_ROOT}/app/views/admin/page/_node.rhtml:44:in
`_run_rhtml_47app47views47admin47page47_node46rhtml'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`compile_and_render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:275:in
`render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb:59:in
`render_partial'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:30:in
`benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb:58:in
`render_partial'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:287:in
`render'
#{RAILS_ROOT}/app/helpers/admin/page_helper.rb:4:in `render_node'
#{RAILS_ROOT}/app/views/admin/page/index.rhtml:14:in
`_run_rhtml_47app47views47admin47page47index46rhtml'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in
`compile_and_render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:806:in
`render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:711:in
`render_with_no_layout'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/layout.rb:247:in
`render_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render'
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1096:in
`perform_action_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:632:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
`call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
`call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
`perform_action'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
`send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
`process_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:624:in
`process_without_session_management_support'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
`process'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in
`process'
#{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:in `dispatch'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in
`process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
`synchronize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
`process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
`process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
`process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
`each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
`run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
/opt/local/bin/mongrel_rails:16:in `load'
/opt/local/bin/mongrel_rails:16

Request

Parameters: None

Show session dump

---
:user: !ruby/object:User
  attributes:
    name: Ollivier R.
    updated_at: 2006-06-08 16:29:44
    created_by: "2"
    admin: t
    notes:
    updated_by:
    id: "2"
    password: ********************************
    login: roberto
    created_at: 2006-06-08 16:29:44
    developer: t
    email: removed_email_address@domain.invalid
  confirm_password: true
  created_by:
  updated_by:
flash: !map:ActionController::Flash::FlashHash {}


Response
Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
John W. Long (Guest)
on 2007-01-27 01:57
(Received via mailing list)
Ollivier R. wrote:
> Showing app/views/admin/page/_node.rhtml where line #44 raised:
>
> The single-table inheritance mechanism failed to locate the subclass:
> 'FilenotfoundpagePage'. This error is raised because the column
> 'class_name' is reserved for storing the class in case of inheritance.
> Please rename this column if you didn't intend it to be used for
> storing the inheritance class or overwrite Page.inheritance_column to
> use another column for that information.

Mmm. That's a problem with one of the migrations. (You did run `rake
db:migrate` didn't you?)

See if this works. Open up your database. And execute the following:

   update pages
     set class_name='FileNotFoundPage'
     where class_name='FilenotfoundpagePage';


--
John L.
http://wiseheartdesign.com
Ollivier R. (Guest)
on 2007-01-27 23:35
(Received via mailing list)
On 1/27/07, John W. Long <removed_email_address@domain.invalid> wrote:
> Mmm. That's a problem with one of the migrations. (You did run `rake
> db:migrate` didn't you?)

I did.

> See if this works. Open up your database. And execute the following:
>
>    update pages
>      set class_name='FileNotFoundPage'
>      where class_name='FilenotfoundpagePage';

Thanks, that fixed it.  Something must have barfed before and I didn't
see it.
This topic is locked and can not be replied to.