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

bug: search raises "NoMethodError (undefined method table_name' for #<Arel::Table..." on rails 7.1.0 #2007

Closed
2 of 4 tasks
Paul-Bob opened this issue Oct 31, 2023 · 1 comment

Comments

@Paul-Bob
Copy link
Contributor

Paul-Bob commented Oct 31, 2023

Describe the bug

When using search with ransack on rails 7.1.0 it raises the following error:

NoMethodError (undefined method `table_name' for #<Arel::Table:0x00007fef389334b8 @name="countries", @klass=Country(id: integer, name: string, bool: boolean, created_at: datetime, updated_at: datetime), @type_caster=#<ActiveRecord::TypeCaster::Map:0x00007fef389333f0 @klass=Country(id: integer, name: string, bool: boolean, created_at: datetime, updated_at: datetime)>, @table_alias=nil>

          table        = attr.arel_attribute.relation.table_name
                                                     ^^^^^^^^^^^
Did you mean?  table_alias):

Steps to Reproduce

Steps to reproduce the behavior:

  1. Type something on any search
  2. See error

System configuration

Avo version:
2.43

Rails version:
7.1.0

Ruby version:
3.1.0

License type:

  • Community
  • Pro

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Screenshots or screen recordings

image

@Paul-Bob
Copy link
Contributor Author

Paul-Bob commented Oct 31, 2023

Upgrading to ransack 4.1 fixes it.

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