crashtech/torque-postgresql

Rails 7 - "uninitialized constant ActiveRecord::Reflection::AssociationReflection::VALID_AUTOMATIC_INVERSE_MACROS"

Closed this issue · 6 comments

Hi,

Not sure if this is too early to file bugs since it's a alpha 02 release of rails.

rails aborted!
NameError: uninitialized constant ActiveRecord::Reflection::AssociationReflection::VALID_AUTOMATIC_INVERSE_MACROS
/Users/yosi/.rvm/gems/ruby-2.7.2/gems/torque-postgresql-2.1.3/lib/torque/postgresql/reflection/belongs_to_many_reflection.rb:59:in `<module:Reflection>'
/Users/yosi/.rvm/gems/ruby-2.7.2/gems/torque-postgresql-2.1.3/lib/torque/postgresql/reflection/belongs_to_many_reflection.rb:5:in `<module:PostgreSQL>'
/Users/yosi/.rvm/gems/ruby-2.7.2/gems/torque-postgresql-2.1.3/lib/torque/postgresql/reflection/belongs_to_many_reflection.rb:4:in `<module:Torque>'
/Users/yosi/.rvm/gems/ruby-2.7.2/gems/torque-postgresql-2.1.3/lib/torque/postgresql/reflection/belongs_to_many_reflection.rb:3:in `<main>'

Remove here - rails/rails@173a112

Quite an easy fix to extend the support

@crashtech it's not the only issue i see with rails 7, now I managed to get my test suite running and it's failing on another thing.
Do you want me to submit issues for that? or it's too early since it's alpha 2 ?

The error I have now is from AR preloader which calls load_records and torque makes it private method.
https://github.com/crashtech/torque-postgresql/blob/master/lib/torque/postgresql/associations/preloader/association.rb#L46
If you want, I can put a reproduce-able test for this

Update: the issue reproduces well when running the specs here with rails 7, I managed to get it fixed with some changes - yosiat@4d6d21d

If you want, I can submit as PR

I think it's a bit early to do preparations for Rails 7 in this line. That particular area tends to change a lot from version to version. Let's wait for the official release and see if that will require Torque v3 or just some minor changes.

Totally acceptable, will wait for official rails release, thanks!

@crashtech Rails 7 is released :)

@crashtech I am seeing some issues with torque and rails 7 (and currently torque is our blocker for rails 7 upgrade).

Can I open issues for rails 7 ?