Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined method `to_sym' for nil:NilClass #3624

Open
drcarrasco opened this issue May 9, 2023 · 0 comments
Open

Undefined method `to_sym' for nil:NilClass #3624

drcarrasco opened this issue May 9, 2023 · 0 comments

Comments

@drcarrasco
Copy link

drcarrasco commented May 9, 2023

Describe the bug
For some reason, some classes don't have names, and this is causing the app to crash.

Reproduction steps
I don't understand why my class doesn't have a name.

Expected behavior
Rails Admin will work correctly.

Additional context

  • rails version: 6.1
  • rails_admin version: 3.1.2
  • rails_admin npm package version: 3.1.2
full stack trace => ["/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config.rb:233:in `model'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin.rb:33:in `config'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/actions/index.rb:25:in `block in '", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/configurable.rb:77:in `instance_eval'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/configurable.rb:77:in `block in register_instance_option'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/proxyable/proxy.rb:27:in `method_missing'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/app/helpers/rails_admin/application_helper.rb:137:in `breadcrumb'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/app/views/layouts/rails_admin/content.html.erb:16:in `__home_danielcarrasco__rbenv_versions_______lib_ruby_gems_______gems_rails_admin_______app_views_layouts_rails_admin_content_html_erb___4124863421041472512_114880'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:247:in `public_send'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:247:in `_run'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:154:in `block in render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:345:in `instrument_render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:152:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:61:in `block (2 levels) in render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:56:in `block in render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:55:in `render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:11:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/renderer.rb:29:in `render_to_object'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/renderer.rb:22:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/helpers/rendering_helper.rb:38:in `block in render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:273:in `in_rendering_context'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/helpers/rendering_helper.rb:34:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/app/views/layouts/rails_admin/application.html.erb:21:in `__home_danielcarrasco__rbenv_versions_______lib_ruby_gems_______gems_rails_admin_______app_views_layouts_rails_admin_application_html_erb___1258668183099005875_112320'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:247:in `public_send'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:247:in `_run'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:154:in `block in render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:345:in `instrument_render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/template.rb:152:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:72:in `block in render_with_layout'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:70:in `render_with_layout'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:55:in `render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/template_renderer.rb:11:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/renderer/renderer.rb:29:in `render_to_object'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/rendering.rb:117:in `block in _render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/base.rb:273:in `in_rendering_context'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/rendering.rb:116:in `_render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/streaming.rb:218:in `_render_template'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/rendering.rb:103:in `render_to_body'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/rendering.rb:52:in `render_to_body'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/renderers.rb:142:in `render_to_body'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/rendering.rb:25:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/rendering.rb:36:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/core_ext/benchmark.rb:14:in `ms'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:46:in `block in render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:86:in `cleanup_view_runtime'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:45:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/wicked_pdf-2.1.0/lib/wicked_pdf/pdf_helper.rb:46:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/wicked_pdf-2.1.0/lib/wicked_pdf/pdf_helper.rb:46:in `render_with_wicked_pdf'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/wicked_pdf-2.1.0/lib/wicked_pdf/pdf_helper.rb:30:in `render'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/actions/show.rb:25:in `block (4 levels) in '", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/mime_responds.rb:214:in `respond_to'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/lib/rails_admin/config/actions/show.rb:23:in `block (2 levels) in '", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/app/controllers/rails_admin/main_controller.rb:38:in `instance_eval'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rails_admin-3.1.2/app/controllers/rails_admin/main_controller.rb:38:in `action_missing'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/base.rb:242:in `_handle_action_missing'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/base.rb:228:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/rendering.rb:30:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actiontext-6.1.6.1/lib/action_text/rendering.rb:20:in `with_renderer'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actiontext-6.1.6.1/lib/action_text/engine.rb:59:in `block (4 levels) in '", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-rails-5.8.0/lib/sentry/rails/controller_transaction.rb:28:in `block in sentry_around_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/hub.rb:100:in `with_child_span'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry-ruby.rb:446:in `with_child_span'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-rails-5.8.0/lib/sentry/rails/controller_transaction.rb:14:in `sentry_around_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/callbacks.rb:41:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/rescue.rb:22:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/instrumentation.rb:33:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/abstract_controller/base.rb:165:in `process'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionview-6.1.6.1/lib/action_view/rendering.rb:39:in `process'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal.rb:190:in `dispatch'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_controller/metal.rb:254:in `dispatch'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:33:in `serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `each'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:842:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/engine.rb:539:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:20:in `block in '", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:49:in `serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `each'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `serve'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:842:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/static.rb:24:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202:in `call!'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/versionist-1.7.0/lib/versionist/middleware.rb:39:in `_call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/versionist-1.7.0/lib/versionist/middleware.rb:17:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/tempfile_reaper.rb:15:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/etag.rb:27:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/conditional_get.rb:27:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/head.rb:12:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/http/permissions_policy.rb:22:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/http/content_security_policy.rb:19:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/session/abstract/id.rb:266:in `context'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/session/abstract/id.rb:260:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/cookies.rb:689:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/migration.rb:601:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:98:in `run_callbacks'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/executor.rb:14:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/better_errors-2.7.0/lib/better_errors/middleware.rb:84:in `protected_app_call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/better_errors-2.7.0/lib/better_errors/middleware.rb:79:in `better_errors_call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/better_errors-2.7.0/lib/better_errors/middleware.rb:57:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-rails-5.8.0/lib/sentry/rails/rescued_exception_interceptor.rb:12:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/web-console-4.0.1/lib/web_console/middleware.rb:132:in `call_app'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/web-console-4.0.1/lib/web_console/middleware.rb:28:in `block in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/web-console-4.0.1/lib/web_console/middleware.rb:17:in `catch'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/web-console-4.0.1/lib/web_console/middleware.rb:17:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/rack/capture_exceptions.rb:28:in `block (2 levels) in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/hub.rb:220:in `with_session_tracking'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry-ruby.rb:375:in `with_session_tracking'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/rack/capture_exceptions.rb:19:in `block in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/hub.rb:59:in `with_scope'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry-ruby.rb:355:in `with_scope'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/rack/capture_exceptions.rb:18:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/rack/logger.rb:37:in `call_app'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/rack/logger.rb:26:in `block in call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:37:in `tagged'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `tagged'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/rack/logger.rb:26:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/request_id.rb:26:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/method_override.rb:24:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/runtime.rb:22:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/executor.rb:14:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/static.rb:24:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-2.2.6.4/lib/rack/sendfile.rb:110:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/actionpack-6.1.6.1/lib/action_dispatch/middleware/host_authorization.rb:148:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-mini-profiler-2.0.4/lib/mini_profiler/profiler.rb:321:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/webpacker-4.2.2/lib/webpacker/dev_server_proxy.rb:23:in `perform_request'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/railties-6.1.6.1/lib/rails/engine.rb:539:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/puma-4.3.1/lib/puma/configuration.rb:228:in `call'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/puma-4.3.1/lib/puma/server.rb:681:in `handle_request'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/puma-4.3.1/lib/puma/server.rb:472:in `process_client'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/puma-4.3.1/lib/puma/server.rb:328:in `block in run'", "/home/danielcarrasco/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/puma-4.3.1/lib/puma/thread_pool.rb:134:in `block in spawn_thread'"]

I think that all instances of to_sym should be preceded by try. Is there a specific reason why try was only added to RailsAdmin::AbstractModel?

# Loads a model configuration instance from the registry or registers
# a new one if one is yet to be added.
#
# First argument can be an instance of requested model, its class object,
# its class name as a string or symbol or a RailsAdmin::AbstractModel
# instance.
#
# If a block is given it is evaluated in the context of configuration instance.
#
# Returns given model's configuration
#
# @see RailsAdmin::Config.registry
def model(entity, &block)
key =
case entity
when RailsAdmin::AbstractModel
entity.model.try(:name).try :to_sym
when Class, ConstLoadSuppressor::ConstProxy
entity.name.to_sym
when String, Symbol
entity.to_sym
else
entity.class.name.to_sym
end
@registry[key] ||= RailsAdmin::Config::LazyModel.new(key.to_s)
@registry[key].add_deferred_block(&block) if block
@registry[key]
end

My code enters the Class, ConstLoadSuppressor::ConstProxy condition and crashes.

P.S. Adding try to the base code makes it work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant