Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks all Rails 5 has_many through relationship #106

Closed
SaimonL opened this issue Oct 3, 2019 · 2 comments
Closed

Breaks all Rails 5 has_many through relationship #106

SaimonL opened this issue Oct 3, 2019 · 2 comments

Comments

@SaimonL
Copy link

SaimonL commented Oct 3, 2019

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
Copy link
Contributor

I think this issue is fixed in 1.4.0.beta1 - April 21, 2021 (20 KB) and should be closed.

@rzane
Copy link
Owner

rzane commented Jun 18, 2021

I'm going to assume this is fixed, but if this is still an issue, please follow up.

@rzane rzane closed this as completed Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants