Breaks all Rails 5 has_many through relationship
Closed this issue · 2 comments
SaimonL commented
Issue
In any Rails 5 application if you create has many through relation then this gem causes it to break.
Reproduction
Just create a new Rails 5 or 6 app and add the following model with migrations.
class User < ApplicationRecord
has_many :memberships
has_many :groups, through: :memberships
end
class Group < ApplicationRecord
has_many :memberships
has_many :users, through: :memberships
end
class Membership < ApplicationRecord
belongs_to :user
belongs_to :group
end
Now when you try to do User.first.groups
it will cash. Remove this gem and it all works fine.
Error I get:
Group.first.users
Group Load (0.5ms) SELECT "groups".* FROM "groups" ORDER BY "groups"."id" ASC LIMIT $1 [["LIMIT", 1]]
Traceback (most recent call last):
ArgumentError (wrong number of arguments (given 3, expected 2))
rocket-turtle commented
I think this issue is fixed in 1.4.0.beta1 - April 21, 2021 (20 KB)
and should be closed.
rzane commented
I'm going to assume this is fixed, but if this is still an issue, please follow up.