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))
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.
Now when you try to do
User.first.groups
it will cash. Remove this gem and it all works fine.Error I get: