Closed
Description
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