The associations generated by groupify and has_members methods lack the inverse_of option.
It should be possible to enable this on a per-call basis to keep backwards compatibility.
Example usage:
class Organization < Group
has_members :managers,
inverse_of: true
end
Which would generate
class Organization < ActiveRecord::Base
has_many :managers,
through: :group_memberships_as_group,
inverse_of: :organizations,
... # The rest of the options
end
Alternatively allow the developer to merge in a (whitelisted?) set of extra keys to the association options hash.
Example of that:
class Organization < Group
has_members :managers,
inverse_of: :organizations
end
For more info on inverse_of specifically: https://www.viget.com/articles/exploring-the-inverse-of-option-on-rails-model-associations