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

Don't return association if table is nil #951

Closed
wants to merge 1 commit into from
Closed

Don't return association if table is nil #951

wants to merge 1 commit into from

Conversation

CGA1123
Copy link
Contributor

@CGA1123 CGA1123 commented Aug 16, 2018

Returning an association here where table == nil will result in a subsequent undefined method '[]' for nil:NilClass being thrown in get_attribute due to Ransack::Adapters::ActiveRecord::context#table_for returning nil.

Falling back to build_association works as expected.

Related #947

@gregmolnar
Copy link
Member

@CGA1123 Thanks for your contribution. I cherry picked your commit and added a spec as well in another PR so closing this.

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

Successfully merging this pull request may close these issues.

2 participants