Closed ghost closed 9 months ago
@taki Have you found any workaround for this yet? Running into this issue as well
@NYDrewReynolds Unfortunately, I have not yet.
Edited the question to bring it to current versions of the code base.
Probably easier to debug if you comment out gem "active_hash"
and just run with ruby -Ilib reproducer.rb
.
It looks like the :through
association is not properly retuning this class because it is not an ActiveRecord::Base
.
At first I thought this was related to the 7.x code that prevents you from creating an association with a non AR model. But this issue has been here since rails 5.2 (maybe before) so it is unrelated.
Tried adding a few methods to quickly get through the error, but it looks pretty deep. Anyone have any thoughts on this?
I think this issue is similar to the one fixed in #272 / #267. Looking.
Something was so elegant about the compute_class
code fix.
agree that we want to avoid monkey patches... just sayin'
Thank you very much.
Steps to reproduce
Run below code.
Expected behavior
The script above should produce no errors, and get physician.
Actual behavior
System configuration
Ruby version: 2.7.4 ActiveHash version: 3.1.0
updated: Ruby version: 3.0.6 ActiveHash version: 3.2.1
updated by @kbrock to bring up to current version of ruby, rails, and active hash