Whenever I update a main record, versions for hundreds associated through 'has_and_belongs_to_many' records are created.
Is that an expected behavior?
class AnyModel < ApplicationRecord
has_and_belongs_to_many :any_associations
end
record = AnyModel.last
record.any_associations.count # => 999999999999
record.touch # this will result in 99999999999 "INSERT INTO `version_associations" SQL queries
Whenever I update a main record, versions for hundreds associated through 'has_and_belongs_to_many' records are created.
Is that an expected behavior?