Migrating to mental


#1

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…

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:ininstantiate’
#{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:incollect!’
#{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:infind_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:infind’
#{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:inload_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:inmethod_missing’
#{RAILS_ROOT}/app/views/admin/page/_node.rhtml:44:in
_run_rhtml_47app47views47admin47page47_node46rhtml' #{RAILS_ROOT}/app/helpers/admin/page_helper.rb:4:inrender_node’
#{RAILS_ROOT}/app/views/admin/page/index.rhtml:14:in
_run_rhtml_47app47views47admin47page47index46rhtml' /opt/local/bin/mongrel_rails:16:inload’
/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:ininstantiate’
#{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:incollect!’
#{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:infind_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:infind’
#{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:inload_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:inmethod_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:incompile_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:inrender_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:inrender_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:inrender_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:insend’
#{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:inrender_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:inrender_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:inrender_without_benchmark’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render' /opt/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1096:inperform_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:incall_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:incall_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:incall’
#{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:incall_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:incall_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:inperform_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:inperform_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:insend’
#{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:inprocess_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:inprocess’
#{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:inprocess’
/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:inprocess’
/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:ineach’
/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:inrun’
/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:innew’
/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:ininitialize’
/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:inrun’
/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:ineach’
/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:inrun’
/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:ininstantiate’
#{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:incollect!’
#{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:infind_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:infind’
#{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:inload_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:inmethod_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:insend’
#{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:inrender_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:inrender’
#{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:inbenchmark’
#{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:inrender’
#{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:incompile_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:inrender_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:inrender_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:inrender’
/opt/local/lib/ruby/1.8/benchmark.rb:293:in measure' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:inrender’
#{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:incall_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:incall’
#{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:incall_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:incall_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:incall’
#{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:inperform_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:inmeasure’
#{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:inperform_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:inprocess_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:inprocess’
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in
process' #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:indispatch’
/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:insynchronize’
/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:inprocess_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:inprocess_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:ininitialize’
/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:inrun’
/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:innew’
/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:inrun’
/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:inrun’
/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:inrun’
/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”}


#2

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


#3

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.