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

collection << item returns incorrect collection.count #138

Closed
barriehadfield opened this issue Mar 17, 2019 · 1 comment
Closed

collection << item returns incorrect collection.count #138

barriehadfield opened this issue Mar 17, 2019 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@barriehadfield
Copy link
Contributor

barriehadfield commented Mar 17, 2019

In poly-assoc3 branch:

class ExerciseType < ApplicationRecord
  has_many :exercise_types_user
  has_many :users, through: :exercise_types_user
end

class User < ApplicationRecord
  has_many :exercise_types_user
  has_many :exercise_types, through: :exercise_types_user
end

class ExerciseTypesUser < ApplicationRecord
  belongs_to :user
  belongs_to :exercise_type
end

# works perfectly:
user.exercise_types << exercise_type

# but here is the bug..
exercise_types.users.count
# returns a number higher than count + 1
# fine after a page refresh, so its just the client count which is not being updated correctly
@catmando catmando added the bug Something isn't working label Jun 18, 2019
@catmando catmando added this to the alpha1.5 milestone Jun 18, 2019
@catmando
Copy link
Contributor

catmando commented Jun 18, 2019

@barriehadfield I think this got fixed with other stuff. I put in a test spec for it, and it passes. Can you verify that it is indeed working on edge, and if not, reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants