You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after adding goldiloader i started seeing this error on my specs:
ArgumentError:
Polymorphic associations do not support computing the class.
# /usr/local/bundle/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:82:in `eager_loadable?'
# /usr/local/bundle/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:114:in `eager_loadable?'
# /usr/local/bundle/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:104:in `auto_include?'
# /usr/local/bundle/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:121:in `load_with_auto_include'
# /usr/local/bundle/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:143:in `find_target'
# ./spec/domains/payments/card/services/authorization_handler_spec.rb:252:in `block (6 levels) in <top (required)>'
expect(app_notification.references.first.notifiable).to eq(payment_card)
I tried to add -> { auto_include(false) } to disable eager loading to the associations on app_notification, even on user. nothing helped.
Is this an issue or misconfiguration?
The text was updated successfully, but these errors were encountered:
luizkowalski
changed the title
got an error while trying to load an polymorphic association
got an error while trying to load a polymorphic association
Apr 7, 2021
Thanks for reporting this issue. I'm able to reproduce the problem which occurs whenever using a polymorphic association with a scope block in Rails 6.0+. I'll work on getting a fix out this week.
Hi
I have the following structure:
I don't have any other validations.
after adding
goldiloader
i started seeing this error on my specs:I tried to add
-> { auto_include(false) }
to disable eager loading to the associations on app_notification, even on user. nothing helped.Is this an issue or misconfiguration?
The text was updated successfully, but these errors were encountered: